Reading and Writing to the same file

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
kevinr
Posts: 2
Joined: 2017-11-22T07:54:06-07:00
Authentication code: 1152

Reading and Writing to the same file

Post by kevinr » 2017-11-22T08:07:37-07:00

I am in the process of upgrading from version 6 to 7 on windows (ImageMagick-7.0.7-11-Q16-x64-dll).

The code we have issues commands which were working but having made one small change to support the new version don't work and report "Permission denied @ error/blob.c/OpenBlob/3315."

>magick.exe convert "218573_75.jpg" -rotate "-90" "218573_75.jpg" fails in v7 and worked in v6

It seems that the issue is that we are reading and writing to the same file since if I change the output filename it works.

>magick.exe convert "218573_75.jpg" -rotate "-90" "218573_75_new.jpg" works in v7

Is there a parameter I have to use now to allow this or is it no longer possible?

Kevin

snibgo
Posts: 9619
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Reading and Writing to the same file

Post by snibgo » 2017-11-22T08:47:24-07:00

Writing to the same file shouldn't be a problem. Perhaps this is a v7 bug.

What happens if you remove "convert", so the command is:

Code: Select all

magick.exe "218573_75.jpg" -rotate "-90" "218573_75.jpg"
snibgo's IM pages: im.snibgo.com

kevinr
Posts: 2
Joined: 2017-11-22T07:54:06-07:00
Authentication code: 1152

Re: Reading and Writing to the same file

Post by kevinr » 2017-11-22T08:54:45-07:00

snibgo - Thanks for your response, I have not tried that. I just found in the documentation that I have to use mogrify.

snibgo
Posts: 9619
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Reading and Writing to the same file

Post by snibgo » 2017-11-22T09:03:27-07:00

You can use mogrify if you want, but you should not need to. Your command should work.
snibgo's IM pages: im.snibgo.com

Post Reply