-
Is getimagesize efficient??
HI,
Please excuse if similar issue has been posted earlier.
I want to check if a remote image exists or not.
say if url is http://example/image.png
and no image exists there, then...??
Earlier I was using @getimagesize function, but later on found this comment saying that it makes server slow for on large images.
http://www.php.net/manual/en/functio...size.php#88793
I don't know if the solution mentioned in that comment is correct rather efficient?
Is there any other efficient, fast, small solution for this?
Thanks in advance...
Regards
-
-
No, not really. Anything with images will be somewhat inefficient. You could instead just verify that the file exists and has a valid extension for images like .jpg but that won't guarantee the file is valid. It would work in most cases though.
Daniel -
Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
-
-
The @ is inefficient. You should suppress errors via your php.ini instead.
-
-
True, but that will suppress all errors: for this sort of test, sometimes you must suppress that to avoid a warning if it fails.
Also, the efficiency lost from the @ compared to the time it takes to process getimagesize() would be insignificant.
Daniel -
Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks