• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 297
  • Last Modified:

Can CFImage "Mirror Print"?

Hi Experts,

I'm using CF8 (hosted at GoDaddy) and I want to "flip" an image to make a mirror image (NOT rotate). I can't see from the documentation that this is supported. Any ideas? Please note I want to do this programmatically (not image by image in PhotoShop etc).
0
simonlea
Asked:
simonlea
  • 3
  • 3
  • 2
  • +1
1 Solution
 
azadisaryevCommented:
0
 
Jones911Commented:
I'm not 100% if you can do it with GoDaddy hosting but here is the code to flip an image:


<!--- Get an image to flip, in this example the google logo --->
<cfimage action="read" source="http://www.google.com/intl/en_ALL/images/logo.gif" name="tempImage" />

<!--- Write it to the browser to prove its the correct way up --->
<cfimage action="writetobrowser" source="#tempImage#" />

<!--- Flip the image --->
<cfset imageFlip(tempImage) />

<!--- Write it to the browser to prove it's now upside down --->
<cfimage action="writetobrowser" source="#tempImage#" />

Open in new window

0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
simonleaAuthor Commented:
Just trying Azadi's approach. "Write to Browser" is disabled at GoDaddy - but I should be able to work around by writing to directories under my control. Will let you all know...
0
 
_agx_Commented:
> "Write to Browser" is disabled at GoDaddy

Unbelievable.  The joys of shared hosting..
0
 
Jones911Commented:
That was just and example.  The key is:

<cfset imageFlip(tempImage) />


Which will work if they are running cf8
0
 
simonleaAuthor Commented:
Yep - it does! For the benefit of others who find this question, the code that works (for me) is attached.

The "save image / display image" is a workaround for GoDaddy which does not support "write to browser" because that creates temporary files (which CF8 automatically cleans up I believe). Maybe I will write some clean up code to remove redundant images - or maybe I'll just clog up their servers until I get close to my disc usage limit. But wait! I don't have a disc usage limit!

Points to Azadi to be fair - his documentation link gave me the answer straight away. Thanks to others for incredibly quick responses.(for me)


<cfoutput>
<!--- Create a ColdFusion image from an existing JPEG file. --->
<cfimage source="blah/blah/15272.jpg" name="myImage">
<!--- Turn on antialiasing to improve image quality. --->
<cfset ImageSetAntialiasing(myImage,"on")>
<!--- Flip the image so that it is a mirror image of the source. --->
<cfset ImageFlip(myImage,"horizontal")>
<cfimage
    action = "write"
    destination = "blah/blah/M15272.jpg"
    source = "#myImage#"
    overwrite = "yes">
</cfoutput>

<img src="blah/blah/M15272.jpg">

Open in new window

0
 
simonleaAuthor Commented:
Can't fault this one - straight to the documentation I hadn't found.
0
 
_agx_Commented:
@simonlea

Sounds good.  I did not even see the other responses before posting, or I would not have bothered to respond ;-) I could see immediately they already gave the right answer!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 3
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now