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

Processing source images with imagick breaks SVG's and PDF's when using Imagick #7541

Closed
robdekort opened this issue Feb 15, 2023 · 4 comments · Fixed by #7666
Closed

Processing source images with imagick breaks SVG's and PDF's when using Imagick #7541

robdekort opened this issue Feb 15, 2023 · 4 comments · Fixed by #7666
Assignees
Labels

Comments

@robdekort
Copy link
Contributor

robdekort commented Feb 15, 2023

Bug description

When you have a Glide preset in place to process source images, it will break/mangle/screw up SVG's.

How to reproduce

  • Use a preset to process source images: 'replacement' => ['w' => 4500, 'q' => 100, 'fit' => 'max']
  • Enable it on the asset container
  • Upload an svg

or

  • Install Peak
  • Upload an SVG to the Images container.

Logs

No response

Environment

Environment
Application Name: Statamic Peak Development
Laravel Version: 9.51.0
PHP Version: 8.1.13
Composer Version: 2.2.7
Environment: local
Debug Mode: ENABLED
URL: statamic-peak.test
Maintenance Mode: OFF

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED

Drivers
Broadcasting: log
Cache: statamic
Database: mysql
Logs: stack / single
Mail: smtp
Queue: sync
Session: file

Statamic
Addons: 4
Antlers: runtime
Stache Watcher: Enabled
Static Caching: Disabled
Version: 3.4.3 PRO

Statamic Addons
studio1902/statamic-peak-browser-appearance: 1.0
studio1902/statamic-peak-commands: 1.21
studio1902/statamic-peak-seo: 1.2.1
studio1902/statamic-peak-tools: 1.1

Installation

Starter Kit using via CLI

Antlers Parser

runtime (new)

Additional details

No response

@jesseleite
Copy link
Member

Note: Only able to reproduce with imagick driver (works fine with gd driver).

Also note: Affects not just svg's, but pdf's as well. Maybe other vector formats too?

@jesseleite jesseleite self-assigned this Mar 7, 2023
@jesseleite jesseleite changed the title Processing source images breaks SVG's Processing source images breaks SVG's and PDF's Mar 7, 2023
@jesseleite jesseleite changed the title Processing source images breaks SVG's and PDF's Processing source images with imagick breaks SVG's and PDF's Mar 7, 2023
@jesseleite jesseleite added the bug label Mar 7, 2023
@jacksleight
Copy link
Contributor

jacksleight commented Mar 7, 2023

Also note: Affects not just svg's, but pdf's as well. Maybe other vector formats too?

I've just run into this as well with EPS files, but I think it could apply to many others. IM supports a lot of input formats. Maybe a safe list would be more robust than a block list?

Personally I'd only want the source image processing to apply to the standard web raster formats. The idea behind this PR was to allow you to process other formats through the Glide tag, but you'd still want the source files to remain intact.

Or maybe the types could be configurable somehow? (for now I've just switched off source image processing completely)

@robdekort
Copy link
Contributor Author

Gotcha. Imagick. Thanks for diving into this Jesse.

@robdekort robdekort changed the title Processing source images with imagick breaks SVG's and PDF's Processing source images with imagick breaks SVG's and PDF's when using Imagick Mar 7, 2023
@robdekort
Copy link
Contributor Author

In case Jesse agrees. Something like this @jacksleight: ['jpg', 'jpeg', 'png', 'gif', 'webp', 'avif', 'bmp', 'tiff']

@jesseleite jesseleite added bug and removed bug labels Mar 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants