Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ColdFusion / Advanced Techniques / September 2007



Tip: Looking for answers? Try searching our database.

Binary Object (Image) to browser

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
romeogq - 14 Sep 2007 00:24 GMT
Coldfusion 8

I am trying to output an image I have store in my mssql 2005 database. This is
what I have so currently...
<cfimage action="writeTobrowser" source="#imagenew(logo)#">

Problem is that the image is being outputed as a .png file, not an animated
.gif file as stored. So how can I go about output the actual file as originally
stored??

P.S. I understand the and have used the option of storing files in structure,
but chose to go the varbinary(MAX) way this time which is why I'm having
issues. Thanks in advance for all those who try and lend some assistance.
Azadi - 14 Sep 2007 04:03 GMT
i may be wrong, but i think there is a license issue with creating .gif
files (just using .gif format, i believe)....
i know other utilities (i.e. imageCFC) that can read and manipulate .gif
files, but will only save the result as .png due to these license issues

just checked the cfimage documentation, and it does say:
"You cannot display a GIF image in a browser. GIF images are
displayed in PNG format."

Signature

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com

romeogq - 14 Sep 2007 04:56 GMT
I was afraid of that. Dang! Thanks for the reply... I guess back to storing the actual files in structure.
rupesh_kumar - 14 Sep 2007 16:23 GMT
cfimage does allow writing gif files. When you use "writeToBrowser" action, by
default it writes the image as png image. However, it does allow you to specify
your own format using format attribute.
So you can use
<cfimage action="writeToBrowser" format="gif" source="#imagenew(logo)#">

Let me know if that does not work.
romeogq - 17 Sep 2007 03:06 GMT
Thanks for the reply rupesh,

But that only goes for standard gif images, animated gifs aren't supported... right??
rupesh_kumar - 17 Sep 2007 10:17 GMT
Hmmm.. thats true. Animated gifs are actually not one image but a set of images
clubbed together in one gif file. so in a sense they are actually like a movie.
When you create image object out of it, image object is created for the first
frame only. and when that image is saved back as gif, all other frames are
lost.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.