getimagesize bug
-
There’s been a couple of threads about performance issues due to getimagesize causing timeouts and high server usage.
Looking at the getImage function under blog2social/includes/Meta.php that retrieves the imagesize for the og:image tag it downloads the local image with an HTTP request, which adds 100ms or so to the load time and potentially causes bottlenecks/timeouts if a lot of requests are made at a time.
I can see further up in that function there is code to retrieve the image dimensions of the featured image stored in postmeta which would be more efficient, and means the HTTP request to the image wouldn’t be required.
However that code only runs if the following is false:
if (isset($this->metaData[$type . ‘_image’]) && !empty($this->metaData[$type . ‘_image’])) {
On a default install with a featured image added to a post this returns true so the dimensions aren’t retrieved via the database.
Could you please look into this to prevent the extra HTTP request in the background and the affect on performance?
- The topic ‘getimagesize bug’ is closed to new replies.