Image Magick Mogrify @ error/blob.c/OpenBlob/3497 Permission Denied

Viewed 11687

I wanted to resize a batch of Image using ImageMagick.

I used this this command found on stackOverflow.

There are two directory on the same level

  • "img_resize" where I want to put my resized images.
  • "image_models" where there are my images.

I used:

magick mogrify -path "img_resize" -resize 512x512 -gravity Center -extent 512x512 "image_models"

And got:

mogrify: unable to open image 'img_resize': Permission denied @ error/blob.c/OpenBlob/3497.
mogrify: no decode delegate for this image format `' @ error/constitute.c/ReadImage/556.

I tried without using two directory:

cd image_models
magick mogrify -resize 512x512 -gravity Center -extent 512x512

It doesn't show errors; But still didn't do anything.

Therefore, the "convert" command work well. The issue come from mogrify.

I'm using windows 10. I used the Terminal and the Terminal run as Admin.

I also tried with ./dir instead of "dir"

Thanks in advance.

1 Answers

If your current directory is the base of your mentioned two folders, use relaive pathes and a wildcard for the source:

magick mogrify -path ".\img_resize\" -resize 512x512 -gravity Center -extent 512x512 ".\image_models\*"

Sample run in A:\Test folder:

> Get-ChildItem -Recurse

Verzeichnis: A:\test

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----       2019-06-11     11:30                image_models
d-----       2019-06-11     11:31                img_resize

    Verzeichnis: A:\test\image_models

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----       2018-11-02     22:32         679624 AucklandOneTreeHillIanRushton_01.jpg
-a----       2018-11-02     22:32         529290 AucklandOneTreeHillIanRushton_02.jpg

    Verzeichnis: A:\test\img_resize

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----       2019-06-11     11:31          53545 AucklandOneTreeHillIanRushton_01.jpg
-a----       2019-06-11     11:31          50687 AucklandOneTreeHillIanRushton_02.jpg
Related