filename as folder name

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
architektura
Posts: 21
Joined: 2016-10-03T05:11:21-07:00
Authentication code: 1151

filename as folder name

Post by architektura »

Hi I convert images into one big image where every small images have name as his names but I want to change a name of big image as folder name is possible ? I read http://www.imagemagick.org/script/escape.php and I see something like that:

convert *.jpg -resize 80% -set filename:f '%t' ../'%[filename:f].jpg'

but I cant use %d directory component of path - any help :)
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: filename as folder name

Post by snibgo »

What version of IM? What platform?

A directory might be something like /users/Alan/mydir\ or c:\users\Alan\mydir\. If you want the output to be named mydir.jpg, you need to do that in a script.
snibgo's IM pages: im.snibgo.com
architektura
Posts: 21
Joined: 2016-10-03T05:11:21-07:00
Authentication code: 1151

Re: filename as folder name

Post by architektura »

maybe You need some pdf from jpg

for /f "tokens=*" %G in ('dir /b /s /a:d "C:\top_path\"') do "C:\im\magick.exe" montage -tile 5x5 %G\*.jpg %G.pdf

this give nice multi pdf

:)

logical tile will be nice feature
I need count of images in current folder -
if count =<5 tile = 5x1
if count=<10 tile = 5x2
ect ...(modulo)
Post Reply