imageSizeByStream return 0 for TIFF image - Index Asset S3 Image
@andris-sevcenko is already working on this.
Since Dec 1, 2020.
- Dominant language
- PHP
- Stars
- 3.6k
- Forks
- 705
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 134
Description
Description
I'm trying to index some TIFF assets from S3.
The problem is that the width and height always return 0.
From my understanding, the function imageSizeByStream (src/helpers/Image.php:210) should return the width and height of the stream but it only works for JPG, PNG, and GIF. The issue starts here: src/services/AssetIndexer.php:552 where the indexer tries to get the width and height of the image from a stream but get [0, 0] back.
I got ~125k TIFF to index, that's why I don't want to cache them locally.
So we may need to add support for other image formats inside imageSizeByStream (TIFF, WEBP, etc)
Steps to reproduce
- Connect to a S3 bucket
- Add some TIFF Images in the bucket
- Index them without cache (--cache-remote-images=0)
- The dimensions will be 0 and save as NULL inside the database.
Additional info
- Craft version: 3.5.12.1
- PHP version: 7.3.8
- Database driver & version:
- Plugins & versions:
Craft CMS S3 - 1.2.11
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.