PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > php.general > [PHP] Difference between imagegif/imagejpeg sending to browser <->saving to file?
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
[PHP] Difference between imagegif/imagejpeg sending to browser <->saving to file?

Réponse
 
LinkBack Outils de la discussion
Vieux 06/05/2008, 10h59   #1
zyro
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut [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 ,

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.

  Réponse avec citation
Vieux 08/05/2008, 11h17   #2
zyro
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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 ,
>
> 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.

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 20h33.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,08366 seconds with 10 queries