• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Binary Object (Image) to browser

Participant ,
Sep 13, 2007 Sep 13, 2007

Copy link to clipboard

Copied

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.
TOPICS
Advanced techniques

Views

586

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 13, 2007 Sep 13, 2007

Copy link to clipboard

Copied

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."

--

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Sep 13, 2007 Sep 13, 2007

Copy link to clipboard

Copied

I was afraid of that. Dang! Thanks for the reply... I guess back to storing the actual files in structure.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Sep 14, 2007 Sep 14, 2007

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Sep 16, 2007 Sep 16, 2007

Copy link to clipboard

Copied

Thanks for the reply rupesh,

But that only goes for standard gif images, animated gifs aren't supported... right??

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Sep 17, 2007 Sep 17, 2007

Copy link to clipboard

Copied

LATEST
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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation