In powershell using imagemagick, how to convert image to a new path -


i want convert tif jpg placed in c:\data\

get-childitem -path $source -filter *.tif | %{ convert $_.fullname "c:\data\$($_.fullname -replace ".tif+$", ".jpg")" } 

but not work.

however works - places converted file in same location original file

get-childitem -path $source -filter *.tif | %{ convert $_.fullname "$($_.fullname -replace ".tif+$", ".jpg")" } 

you're messing destination path concatting c:\data $_.fullname try $_.name property:

get-childitem -path $source -filter *.tif | %{ convert $_.fullname "c:\data\$($_.name -replace ".tif+$", ".jpg")" } 

Comments

Popular posts from this blog

Django REST Framework perform_create: You cannot call `.save()` after accessing `serializer.data` -

Why does Go error when trying to marshal this JSON? -