Reply to Re: get image size from binary data

Your name:

Reply:


Posted by Christoph Burschka on 06/28/07 09:32

peter schrieb:
>>Yeah, so I'd be downloading the image data, saving it to a temporary
>>file, reading the temp file into the buffer and getting the header. Not
>>exactly efficient.
>>
>>Thanks for imagecreatefromstring(); that was exactly the function I was
>>looking for!
>
>
> How else do you expect a system to know details of files on other systems
> without downloading them?
>
> I have a book beside me how many pages has it got, what is the author and
> what is the title? This is basically what you are wanting your script to do.
>
>

To complete the analogy, you open the book and count the pages. You do
not xerox the book page by page, then open the copy. ;)

It doesn't matter if fsockopen(url) -> imagecreatefromstring() ->
imagesx() uses temporary files (a process I can't influence anyway),
fsockopen() -> fwrite() -> getimagesize() is likely to use one more.

Even if they are equally efficient, the first method handles it in the
background without making me juggle files in my own code, removing a
frequent source of bugs.

--
cb

[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

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация