Re: JPEG info needed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Re-read the docs more carefully.

The second arg is optional, and it returns the PRIOR state of the
interlaced-ness (or progressive-ness for a JPEG).

Standard computer-science function trick to return prior state when
altering state, and to simply return state if the second arg is not
passed in.

So if you do not pass in a second arg, you should be getting the state
of the JPEG.

Try it.

On Wed, January 24, 2007 7:20 pm, Gerry Danen wrote:
> Richard,
>
> imageinterlace() turns the interlace bit on or off. It only returns 1
> if you set it to 1 as the second parameter...
>
> Thanks
>
> Gerry
>
> On 1/24/07, Richard Lynch <ceo@xxxxxxxxx> wrote:
>> On Wed, January 24, 2007 12:08 am, Gerry Danen wrote:
>> >> One other possibility is to see what happens if you do
>> >> imagefromjpeg()
>> >> on a progressive JPEG -- There amy be functions in GD that will
>> tell
>> >> you if the JPEG is progressive, once you have sucked it into
>> PHP...
>> >
>> > Any idea which ones to look at?
>>
>> No, but a quick search on php.net for "JPEG progress" with "online
>> documentation" from the popup yeilded:
>>
>> http://us3.php.net/manual/en/function.imageinterlace.php
>> "If the interlace bit is set and the image is used as a JPEG image,
>> the image is created as a progressive JPEG.
>>
>> This function returns whether the interlace bit is set for the
>> image. "
>>
>> Presumably, then, this would work:
>>
>> <?php
>>   $filename = '/full/path/to/filename.jpg';
>>   $jpeg = imagecreatefromjpeg($filename);
>>   $progressive = imageinterlace($jpeg);
>>   if ($progressive) echo "$filename is progressive.\n";
>>   else echo "$filename is NOT progressive.\n";
>> ?>
>>
>


-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux