simonlea
asked on
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).
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).
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Do you mean something like this?
http://www.bennadel.com/blog/1164-Reflecting-Images-With-ImageUtils-cfc-ColdFusion-Image-Component.htm
http://www.bennadel.com/blog/1164-Reflecting-Images-With-ImageUtils-cfc-ColdFusion-Image-Component.htm
ASKER
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...
> "Write to Browser" is disabled at GoDaddy
Unbelievable. The joys of shared hosting..
Unbelievable. The joys of shared hosting..
That was just and example. The key is:
<cfset imageFlip(tempImage) />
Which will work if they are running cf8
<cfset imageFlip(tempImage) />
Which will work if they are running cf8
ASKER
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)
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">
ASKER
Can't fault this one - straight to the documentation I hadn't found.
@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!
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!
Open in new window