Menu

#304 gm mogrify output-directory fails

v1.0_(example)
closed-invalid
None
5
2016-02-22
2015-07-03
No

When I try to convert TIFF to png thumbnails specifying the output directory, mogrify comes back with an error message that suggests the output directory specified has been altered.

themis jlpoole # eix -I magick
[I] media-gfx/graphicsmagick
Available versions: 1.3.18 ~1.3.19 ~1.3.20-r1 {X bzip2 cxx debug fpx imagemagick jbig jpeg jpeg2k lcms lzma modules openmp perl png postscript q16 q32 static-libs svg threads tiff truetype webp wmf zlib}
Installed versions: 1.3.18(03:11:18 PM 05/25/2015)(X bzip2 cxx imagemagick jpeg lcms lzma modules openmp perl png postscript svg tiff truetype wmf zlib -debug -fpx -jbig -jpeg2k -q16 -q32 -static-libs -threads)
Homepage: http://www.graphicsmagick.org/
Description: Collection of tools and libraries for many image formats

themis jlpoole #

jlpoole@themis ~/ep/trunk/perl $ ls -la /home/jlpoole/ed/hann/trem/solo/P1
total 12
drwxr-xr-x 3 jlpoole jlpoole 4096 Jul 2 21:31 .
drwxr-xr-x 3 jlpoole jlpoole 4096 Jul 2 21:29 ..
drwxr-xr-x 2 jlpoole jlpoole 4096 Jul 2 21:31 thmb
jlpoole@themis ~/ep/trunk/perl $ ls /home/jlpoole/ed/hann/trem/solo/P\:/hann/trem/solo/P1/.tif
/home/jlpoole/ed/hann/trem/solo/P:/hann/trem/solo/P1/EVE0001.tif
/home/jlpoole/ed/hann/trem/solo/P:/hann/trem/solo/P1/EVE0002.tif
/home/jlpoole/ed/hann/trem/solo/P:/hann/trem/solo/P1/EVE0003.tif
/home/jlpoole/ed/hann/trem/solo/P:/hann/trem/solo/P1/ODD0001.tif
/home/jlpoole/ed/hann/trem/solo/P:/hann/trem/solo/P1/ODD0002.tif
/home/jlpoole/ed/hann/trem/solo/P:/hann/trem/solo/P1/ODD0003.tif
jlpoole@themis ~/ep/trunk/perl $ gm mogrify -density 72x72 -resize 9% -format png -output-directory /home/jlpoole/ed/hann/trem/solo/P1/thmb /home/jlpoole/ed/hann/trem/solo/P\:/hann/trem/solo/P1/
.tif
gm mogrify: Unable to open file (/hann/trem/solo/P1/EVE0001.png) [No such file or directory].
jlpoole@themis ~/ep/trunk/perl $

The output directory is available and writable, and the input files exist (however, the directory they are in is READ-ONLY, this is by design), yet gm mogrify complains "Unable to open file..."

Discussion

  • John L. Poole

    John L. Poole - 2015-07-03

    I found what is causing the problem for me. If you use a full path for the source file(s), the directory specified will be appending to the output_dir.

    The work-around is to change directgory to the directory where the files are located so they may be specified simply as "*.tif" then there will be no directory prefix appended to the specified output directory.

     
  • Bob Friesenhahn

    Bob Friesenhahn - 2015-07-03

    Yes, it just appends the relative path to the input files to the specified directory to create the output paths (with optional format/extension transformation). It would be nice if it was smarter and could support substitution rules to recursively work on large trees of files.

     
  • John L. Poole

    John L. Poole - 2015-07-03

    I'll try to give a couple of hours and see if I can tweak that in the code, or at least submit some documentation suggestions alerting users of this behavior.

     
  • Bob Friesenhahn

    Bob Friesenhahn - 2016-02-22
    • status: open --> closed-invalid
    • assigned_to: Bob Friesenhahn
     
  • Bob Friesenhahn

    Bob Friesenhahn - 2016-02-22

    It has been determined that the issue was due to not understanding how the feature works.

     

Log in to post a comment.

MongoDB Logo MongoDB