Create missing thumbnails within a folder tree
Posted: 2018-01-11T18:33:45-07:00
I am trying to create thumbnail images in a subfolder to where the photos are and I would like to specify which photos to create thumbnails for in a text file.
I don’t want to generate thumbnails for all the photos in a folder as in most cases, this has already occurred. Sometimes a new photo is placed into an existing folder, such as a cover image for a video and I only need to create thumbnails for the new images. I already have a way of creating a list of files that need to have thumbnails created. However I can’t get a windows command line string working that reads the file and creates the desired thumbnails. A second issue is that I do not yet know how to take the path of the original image and use this path as a base path for saving the output file.
I have developed an image information system based on ms-access. When photos are imported into a the underlying folder structure, I create thumbnails for the photos and put these in a thumbs subdirectory inside the same folder as the photos. An example is below.
F:\2017\2017-12-19\Card_3034-3534\ is where the photos are; and
F:\2017\2017-12-19\Card_3034-3534\Thumbs\ is where the thumbnails are.
In my tests, the command below works, but the input file is hardwired as is the path for the output.
If I try to use the @file syntax, things do not work
I get the following error message for each file listed in the text file:
convert: UnableToOpenBlob '@F:C:\Temp\ImageMagickTest\IMG_2547.JPG': Invalid argument @ error/blob.c/OpenBlob/3335.
Can you please tell me what this error means. Could you also please tell me how to get the path from each input file and use that path as a base for each output file.
In the text file which specifies the filenames, I am assuming that the files do not have to be in the same directory. It would be great to scan a folder tree, build up a list of missing thumbnails in a text file (in VBA) and then run ImageMagick which reads the text file and then generates all the thumbnails.
Skippy
I don’t want to generate thumbnails for all the photos in a folder as in most cases, this has already occurred. Sometimes a new photo is placed into an existing folder, such as a cover image for a video and I only need to create thumbnails for the new images. I already have a way of creating a list of files that need to have thumbnails created. However I can’t get a windows command line string working that reads the file and creates the desired thumbnails. A second issue is that I do not yet know how to take the path of the original image and use this path as a base path for saving the output file.
I have developed an image information system based on ms-access. When photos are imported into a the underlying folder structure, I create thumbnails for the photos and put these in a thumbs subdirectory inside the same folder as the photos. An example is below.
F:\2017\2017-12-19\Card_3034-3534\ is where the photos are; and
F:\2017\2017-12-19\Card_3034-3534\Thumbs\ is where the thumbnails are.
In my tests, the command below works, but the input file is hardwired as is the path for the output.
Code: Select all
C:\ImageMagick-7.0.7-21-portable-Q16-x64\magick convert "C:\Temp\ImageMagickTest\IMG_2547.JPG"
-resize 640x480 -set filename:f "%t"
"C:\Temp\ImageMagickTest\Thumbs\%[filename:f].jpg"
Code: Select all
C:\ImageMagick\ImageMagick-7.0.7-21-portable-Q16-x64\magick convert @F:\PhotoSessions\PhotoHarvester\Pages\NeedThumbsTest.txt
-resize 640x480 -set filename:f "%t"
"C:\Temp\ImageMagickTest\Thumbs\%[filename:f].jpg"
convert: UnableToOpenBlob '@F:C:\Temp\ImageMagickTest\IMG_2547.JPG': Invalid argument @ error/blob.c/OpenBlob/3335.
Can you please tell me what this error means. Could you also please tell me how to get the path from each input file and use that path as a base for each output file.
In the text file which specifies the filenames, I am assuming that the files do not have to be in the same directory. It would be great to scan a folder tree, build up a list of missing thumbnails in a text file (in VBA) and then run ImageMagick which reads the text file and then generates all the thumbnails.
Skippy