Skip to content

php bin/magento catalog:images:resize does not process hidden images. #28239

Closed
@gwharton

Description

@gwharton

Preconditions (*)

  1. Magento 2.4-develop

Steps to reproduce (*)

  1. Create a Product
  2. Assign Image 1 to product and set to be visible on product page
  3. Assign Image 2 to product and set to be hidden on product page
  4. Save the product

Expected result (*)

  1. View the product page, only Image 1 should be visible
  2. pub/media/catalog/cache folder should contain resized Image 1's
  3. pub/media/catalog/cache folder should contain resized Image 2's
  4. Clear image cache
  5. Run php bin/magento catalog:images:resize
  6. pub/media/catalog/cache folder should contain resized Image 1's
  7. pub/media/catalog/cache folder should contain resized Image 2's

Actual result (*)

  1. Only Image 1 is visible on product page ✅
  2. Image 1 is present in cache in resized states ✅
  3. Image 2 is present in cache in resized states ✅
  4. Cache is cleared ✅
  5. Image resize command processes 1 image, not 2 ❌
  6. pub/media/catalog/cache folder should contain resized Image 1's ✅
  7. pub/media/catalog/cache folder does not contain resized Image 2's ❌

Images that are hidden from the product page are not processed by the image resize command. They should be. Just because they are hidden from the product page, doesn't mean they won't be used elsewhere.

Magento is written so that hiding the product image, actually sets it to disabled.

IMHO setting a product image to disabled, and setting it to be hidden on product page are two very different settings, but magento currently treats them as the same.

The confusion stems from the hidden setting being stored in the database as the field disabled. A hidden image is NOT a disabled image, and should still be processed, just not displayed on the product page, otherwise, what is the point of the hidden setting?

Additional Information

#28239 (comment)

Metadata

Metadata

Assignees

Labels

Fixed in 2.4.xThe issue has been fixed in 2.4-develop branchIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P2A defect with this priority could have functionality issues which are not to expectations.Progress: doneReported on 2.4.0Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchTriage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject itimprovement

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions