Reply to Re: How to grayscale a gif using bit-swapping

Your name:

Reply:


Posted by Kimmo Laine on 03/26/07 08:13

spam@outolempi.net | rot13(xvzzb@bhgbyrzcv.arg)
"Lars Erik Bryld" <larserik@dadlnet.invalid> wrote in message
news:ifoxx8z4aye5.dlg@lebryld.fqdn...
> Scripsit Kimmo Laine:
>
>>> $l = (1 << (ord($header[10]) & 7) + 1);
>>
>> Have you tested that this actually gives the correct value? Just
>> that it looks a bit.. hmm.. error-bound? :) Although it does seem
>> to be the same as the original...
>
> Tested it, at it seems to work. Most GIFS produce the value 256, and a
> B/W GIF produces 2 as it should.
>
>> If the goal here is to write the same value three times (for r,g,b)
>> you want str_repeat(chr($gray),3). 3*chr($gray) will give you
>> unexpected results.
>
>
> Tried yoru suggestion, but same result, alas.
>
>>> $rest = fread($fi, 99999999999999999999);
>>> fwrite($fo, $rest);
>>>
>>> fclose($fi);
>>> fclose($fo);
>
> This is what I suspect is not doing what I thought it would.
>

Try this instead:
while(!feof($fi) ){
fwrite($fo, fread($fi, 256));
}


--
"Ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" - lpk
http://outolempi.net/ahdistus/ - Satunnaisesti pδivittyvδ nettisarjis

[Back to original message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация