Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

catalog:images:resize = getimagesize(): Read error! in vendor/magento/module-catalog/Model/Product/Image.php on line 410 if an image is 0 bytes #8204

Closed
spyrule opened this issue Jan 19, 2017 · 7 comments
Assignees
Labels
bug report Component: Catalog Fixed in 2.2.x The issue has been fixed in 2.2 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release

Comments

@spyrule
Copy link

spyrule commented Jan 19, 2017

When I attempt to execute:
php bin\magento catalog:images:resize

After a period of time, I receive this error:

Notice: getimagesize(): Read error! in /vendor/magento/module-catalog/Model/Product/Image.php on line 410

However, no report is pushed into any log file, so there is no way to find out the file causing the read error.

After some digging I realized its due to images that have a zero byte size (I use a 3rd party image upload tool that will upload zero byte files (ticket is open with them as well)

Luckily, I upload all of my files from a single image directory, so I was able to identify the offending file, but many won't be this lucky.

Preconditions

  1. Magento 2.1.3
  2. PHP 7
  3. nginx - hosted server

Steps to reproduce

  1. Upload a file into a product, make sure its a zero byte file, and make it the image/thumbnail/small reference.
  2. go to the command line, and execute php bin\magento catalog:images:resize
  3. after a period of time, the above error will appear.

Expected result

  1. It should just skip the offending file, and/or update the log file to indicate which/where the problematic file resides.
@xmav xmav self-assigned this Jan 24, 2017
@xmav xmav added Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development 2.0.x labels Jan 24, 2017
@xmav
Copy link
Contributor

xmav commented Jan 24, 2017

@spyrule Thanks for reporting this issue.
We've created internal ticket MAGETWO-63599 to address this issue.

@xmav xmav removed their assignment Jan 24, 2017
@magento-engcom-team magento-engcom-team added 2.0.x Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development bug report Component: Catalog Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed labels Sep 11, 2017
@magento-engcom-team magento-engcom-team added Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed labels Oct 2, 2017
@magento-engcom-team magento-engcom-team added 2.2.x Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release labels Oct 19, 2017
@magento-engcom-team
Copy link
Contributor

@spyrule, thank you for your report.
We've created internal ticket(s) MAGETWO-63599 to track progress on the issue.

@jonashrem
Copy link
Contributor

I'm working on it #SQUASHTOBERFEST

@okorshenko
Copy link
Contributor

Hi @spyrule
The issue has been fixed and delivered in 2.2-develop branch. Will be available with upcoming patch release.

@okorshenko okorshenko added the Fixed in 2.2.x The issue has been fixed in 2.2 release line label Dec 13, 2017
taskula pushed a commit to Hypernova-Oy/magento2 that referenced this issue Jun 24, 2019
…error! in vendor/magento/module-catalog/Model/Product/Image.php on line 410 if an image is 0 bytes magento#8204

- Added checks for zero byte files
taskula pushed a commit to Hypernova-Oy/magento2 that referenced this issue Jun 24, 2019
…error! in vendor/magento/module-catalog/Model/Product/Image.php on line 410 if an image is 0 bytes magento#8204

- Added checks for zero byte files
taskula pushed a commit to Hypernova-Oy/magento2 that referenced this issue Jun 24, 2019
…error! in vendor/magento/module-catalog/Model/Product/Image.php on line 410 if an image is 0 bytes magento#8204

- Fix for integration tests
taskula pushed a commit to Hypernova-Oy/magento2 that referenced this issue Jun 24, 2019
…error! in vendor/magento/module-catalog/Model/Product/Image.php on line 410 if an image is 0 bytes magento#8204

- Added integration test
taskula pushed a commit to Hypernova-Oy/magento2 that referenced this issue Jun 24, 2019
…error! in vendor/magento/module-catalog/Model/Product/Image.php on line 410 if an image is 0 bytes magento#8204

- Static test fixes
taskula pushed a commit to Hypernova-Oy/magento2 that referenced this issue Jun 24, 2019
…error! in vendor/magento/module-catalog/Model/Product/Image.php on line 410 if an image is 0 bytes magento#8204

- Static test fixes
taskula pushed a commit to Hypernova-Oy/magento2 that referenced this issue Jun 24, 2019
- fixed "[GitHub] catalog:images:resize = getimagesize(): Read error! in vendor/magento/module-catalog/Model/Product/Image.php on line 410 if an image is 0 bytes magento#8204"
- fixed "CMS page of the second website with same URL key as first website, show content of the First website instead of second website content."
- fixed "Error appears when a restricted user tries to add a new category from the product page"
- fixed "Product attribute cannot be edited if the attribute was created with 2 same values"
- fixed "Invalid join condition in Product Flat Indexer"
- fixed "Fatal error on Import/Export page if deleted category ids exist in category path"
@wutever0
Copy link

Hi ... Is this fixed? Because I can see it is still happening with me on 2.3.2.
In my case i have just migrated from 1.9 to 2.3.2

@sb-rustam
Copy link

I got the same problem on 2.3.2 as well. Ran this command to find and delete files with 0 bytes:

find <Magento root/pub/media/ -type f -size 0 | xargs rm -f

@panchyshnyy-p
Copy link

panchyshnyy-p commented Jan 13, 2021

Hi, guys! The problem is still present in 2.3.2.
It something with file uploading feature?
I'm using CDN plugin from PotatoCommerce and everything is good, images are uploading without errors but from time to times images (in pub/media folder) become 0 bytes size.
I can't figure out why it happens. Has this been fixed in latest versions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Component: Catalog Fixed in 2.2.x The issue has been fixed in 2.2 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release
Projects
None yet
Development

No branches or pull requests

10 participants