Problem using GD library ImageJPEG function

This is a discussion on Problem using GD library ImageJPEG function within the PHP Language forums, part of the PHP Programming Forums category; hello newsgroup, I just discovered a weird effect in my php code. here is the flow of my code: 1. ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-26-2005
André Gasser
 
Posts: n/a
Default Problem using GD library ImageJPEG function

hello newsgroup,

I just discovered a weird effect in my php code. here is the flow of my
code:


1. upload jepg file to server
2. create new (empty) jpeg file using imagecreatefromjpeg() function
3. use imagecopyresampled to resize src image and store in newly created
image from step 2.
4. use imagejpeg to get new jpeg data
5. store that data in the mysql database

NOW: when i use imagejpeg using 100% image quality, some images in the
database are corrupt, but NOT ALL only some of them.

when i reduce image quality to 60% i had no problem using a picture
which hat problem with 100%. images are ok this way.

does this have some logical explanation? is this a bug in the gd or
something?

I use PHP 5.0.2, GD bundled (2.0.28 compatible), and mysql 4.x

I will analyze that code in more detail...


thanx !
andré

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Reply With Quote
  #2 (permalink)  
Old 02-26-2005
André Gasser
 
Posts: n/a
Default Re: Problem using GD library ImageJPEG function

André Gasser schrieb:
> hello newsgroup,
>
> I just discovered a weird effect in my php code. here is the flow of my
> code:
>
>
> 1. upload jepg file to server
> 2. create new (empty) jpeg file using imagecreatefromjpeg() function
> 3. use imagecopyresampled to resize src image and store in newly created
> image from step 2.
> 4. use imagejpeg to get new jpeg data
> 5. store that data in the mysql database
>
> NOW: when i use imagejpeg using 100% image quality, some images in the
> database are corrupt, but NOT ALL only some of them.
>
> when i reduce image quality to 60% i had no problem using a picture
> which hat problem with 100%. images are ok this way.
>
> does this have some logical explanation? is this a bug in the gd or
> something?
>
> I use PHP 5.0.2, GD bundled (2.0.28 compatible), and mysql 4.x
>
> I will analyze that code in more detail...
>
>
> thanx !
> andré
>
> ----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet
> News==----
> http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+
> Newsgroups
> ----= East and West-Coast Server Farms - Total Privacy via Encryption =----



WOW!

Images become good if I use the call:

imageinterlace($myimage, true);

the doc says, that in this way, a progressive jpeg is created.

they even get good if I use a quality of 100%!!

very strange......

can someone explain this behaviour to me? thx! :-)

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB 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 01:14 PM.


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