cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2: Inline HTML Styles Lost on Product Images Edited in Photo Editing Software

Magento 2: Inline HTML Styles Lost on Product Images Edited in Photo Editing Software

Has anyone encountered issues with custom HTML styles not displaying correctly for images that were edited in photo editing software like Meitu, Adobe Illustrator, or Lightroom before uploading to Magento 2? I'm trying to add inline styles to make these product images stand out, but certain styles (like borders and shadows) aren’t rendering as expected.
Here’s an example of the HTML I'm using:

<img src="path/to/image.jpg" style="border: 2px solid #333; box-shadow: 5px 5px 10px rgba(0,0,0,0.5);" alt="Styled Product Image">

I’ve tried a few things:

  1. Ensuring the photo editing software saves images in compatible formats (JPEG/PNG).
  2. Adjusting HTML filtering settings in Magento, but it doesn’t seem to preserve these inline styles.

Is there a known issue with how Magento handles images after they’ve been edited externally, or does anyone have a workaround to ensure these inline styles are applied correctly?