[PHP] Difference between imagegif/imagejpeg sending to browser <->saving to file?

This is a discussion on [PHP] Difference between imagegif/imagejpeg sending to browser <->saving to file? within the PHP General forums, part of the PHP Programming Forums category; Hello together, I stumbled onto a curious problem: i am generating a jpeg/gif with the imagejpeg/imagegif functions (type ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 1 Week Ago
zyro
 
Posts: n/a
Default [PHP] Difference between imagegif/imagejpeg sending to browser <->saving to file?


Hello together,

I stumbled onto a curious problem:
i am generating a jpeg/gif with the imagejpeg/imagegif functions (type does
not alter the result).

Example color "#ff0000": The hexToRGB coversion etc is all working fine. The
image (if its send directly to the browser via header and
imagegif/imagejpeg) is displayed 100% correctly.
But if i save it to a file on the servers file system, the red above gets
lime green. And not only those two colors are bugged: It looks like the
whole palette gets scrambled up ???

So my question: Is there a-n-y difference between sending and saving the
image?
Or do I have to do some additional work before an image can be saved
correctly? php func reference says something about using
imagecolortransparent() on the image first to achieve the 89a format (in
case of gif) but again: This does not alter the result either. Also,
transparency is not needed at this point but used in images that are merged
(gifs) to achieve the final result.

Another interesting point:
- generated image sent to browser, properties: ~3kb
- generated image, saved in filesys, properties: ~15kb
What explains that diff in filesize?

Thanks for your help,

greets,

zyro
--
View this message in context: http://www.nabble.com/Difference-bet...p17078670.html
Sent from the PHP - General mailing list archive at Nabble.com.

Reply With Quote
  #2 (permalink)  
Old 5 Days Ago
zyro
 
Posts: n/a
Default Re: [PHP] Difference between imagegif/imagejpeg sending to browser<-> saving to file?


Lo again,

found my mistake.. in fact, it was the hex-to-rgb conversion not working
properly in some cases.

[SUBJECT CLOSED]


zyro wrote:
>
> Hello together,
>
> I stumbled onto a curious problem:
> i am generating a jpeg/gif with the imagejpeg/imagegif functions (type
> does not alter the result).
>
> Example color "#ff0000": The hexToRGB coversion etc is all working fine.
> The image (if its send directly to the browser via header and
> imagegif/imagejpeg) is displayed 100% correctly.
> But if i save it to a file on the servers file system, the red above gets
> lime green. And not only those two colors are bugged: It looks like the
> whole palette gets scrambled up ???
>
> So my question: Is there a-n-y difference between sending and saving the
> image?
> Or do I have to do some additional work before an image can be saved
> correctly? php func reference says something about using
> imagecolortransparent() on the image first to achieve the 89a format (in
> case of gif) but again: This does not alter the result either. Also,
> transparency is not needed at this point but used in images that are
> merged (gifs) to achieve the final result.
>
> Another interesting point:
> - generated image sent to browser, properties: ~3kb
> - generated image, saved in filesys, properties: ~15kb
> What explains that diff in filesize?
>
> Thanks for your help,
>
> greets,
>
> zyro
>


--
View this message in context: http://www.nabble.com/Difference-bet...p17123492.html
Sent from the PHP - General mailing list archive at Nabble.com.

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 12:26 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0