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

Issue overwriting image when in_place is not specified #97

Closed
nathany-copia opened this issue May 21, 2021 · 4 comments
Closed

Issue overwriting image when in_place is not specified #97

nathany-copia opened this issue May 21, 2021 · 4 comments
Labels

Comments

@nathany-copia
Copy link

Running into an recent issue when using mogrify 0.8.0 to generate a thumbnail. It is generating the thumbnail file with the specified name, but it is also overwriting the original file with the thumbnail.

src = Path.join(folder, filename)
dest = Path.join(folder, "thumb_#{filename}")

src
|> Mogrify.open()
|> Mogrify.resize_to_limit(@thumb_size)
|> Mogrify.save(path: dest)
|> Map.get(:path)

I think this issue started when upgrading to the latest imagemagick: stable 7.0.11-13.

Wondering if you have any insights or if you can reproduce it before opening an issue over at: https://github.com/ImageMagick/ImageMagick/issues. Thanks.

@yossarin
Copy link

yossarin commented Jul 2, 2021

This is really an awful bug. Spent a lot of time to catch it, especially when calling Mogrify.save() concurrently

@sfusato
Copy link

sfusato commented Jul 2, 2021

I was going crazy until I finally figured out the issue. 30 mins ago I've updated my dev system (Manjaro) and I assume ImageMagick had an update as well.

I've downgraded ImageMagick (7.0.11.14-1 => 7.0.11.9-1) and the bug is no longer happening.

@talklittle
Copy link
Collaborator

I have reported the bug upstream: ImageMagick/ImageMagick#3893

Thanks to commenters who included their ImageMagick version numbers.

@talklittle
Copy link
Collaborator

The upstream behavior is apparently here to stay. So we have released mogrify v0.9.0 to fix this issue by using convert and identify executables, instead of mogrify, when it is undesirable to overwrite the input file. (save/2 with in_place: true still uses mogrify.) See #99

Leaving this issue open for now for visibility.

@talklittle talklittle added the bug label Jul 4, 2021
@talklittle talklittle pinned this issue Jul 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants