Images stored on S3 return NULL for width/height
Spun from #429
Expected behavior
{{ image.width }} should always return an integer based on the width of the image (same goes for height)
Actual behavior
Images stored on S3 return null
I've tested this locally and it seems resolved... here's the method.
Environment
VVV with PHP 5.6 and WordPress 4.7. S3 Offload Lite and AWS plugins running.
Steps
- Create a new post, upload an image and set it as the featured image.
- Observe that featured image is hosted on an S3 bucket (something like
http://s3.amazonaws.com/timbertester/wp-content/uploads/2016/06/20110725/hallway-toned.jpg) - In the front-end template call
{{ post.thumbnail.width }}and have it accurately report the width of the uploaded image.
@tvanantwerp do you think we're good here?
Sorry for late response--was AFK for a bit. Is this in 1.2.4? I've upgraded locally and tested this with a new post and image upload and still get NULL.
Ugh!!! can you let me know what steps you followed? I did a local test (see above) but got the values I was expecting
Running WordPress 4.7.2 on MAMP with Apache and PHP 7.0.12. I first tried WordPress's plugin updates. When that failed, I tried manually deleting and replacing all of Timber with the latest download from wordpress.org.
This:
{{dump(post.thumbnail.width)}}
{{dump(post.thumbnail.height)}}
Returns this:
NULL
NULL
Same here on 1.7.1. Workaround is to use this in PHP:
unserialize($post->thumbnail()->_wp_attachment_metadata)['width']
Is this issue resolved? I'm still experiencing this while using WP Offload Media plugin.
Based on the reports it seems like this is still an issue. Reopening.
As discussed yesterday, we are going to close this since this is such an old issue. If anyone still runs into issues, please let us know.
@Levdbas this is till definitely an issue for users of https://github.com/humanmade/S3-Uploads
Hi @conwaydev , are you able to help us debug this issue?