Page 1 of 1
Mogrify keeps adding " ~ " to extension.
Posted: 2015-02-12T11:17:34-07:00
by pancakegh
Hello,
I have a problem that mogrify keeps adding the "~" symbol behind my files.
I am trying to resize and add white space to 7 images
the file structure is as follows:
C:\Users\webdesign\Desktop\aanpassingen\ (this folder contains 7 .jpg files that need the same cropping and added white borders.
this is the code I am using:
mogrify -resize 450x450 C:\Users\webdesign\Desktop\aanpassingen\2\*.jpg: -gravity center -background white -extent 500x500 C:\Users\webdesign\Desktop\aanpassingen\2\*.jpg
What seems to be the problem that is causing the files with ~ to appear?
Here's a screenshot:
http://pbrd.co/1DK58wD
Re: Mogrify keeps adding " ~ " to extension.
Posted: 2015-02-12T11:54:25-07:00
by snibgo
I don't use mogrify, but the syntax looks wrong. What is "C:\Users\webdesign\Desktop\aanpassingen\2\*.jpg:", with the colon at the end, for?
Re: Mogrify keeps adding " ~ " to extension.
Posted: 2015-02-12T12:02:18-07:00
by pancakegh
I have no idea really, I found an example syntax and added my own paths.
It also works like this:
mogrify -resize 450x450 -gravity center -background white -extent 500x500 C:\Users\webdesign\Desktop\aanpassingen\2\*.jpg
It does the trick, but duplicates every image and adds a ~ to the end. So it overwrites the original file (wich is good) but why does it make those extra files? Am I missing a piece of code?
Re: Mogrify keeps adding " ~ " to extension.
Posted: 2015-02-12T13:14:54-07:00
by fmw42
try adding -format jpg before the C:\...
Perhaps your input files have spaces at the beginning or some other hidden character?
Re: Mogrify keeps adding " ~ " to extension.
Posted: 2015-02-12T14:03:22-07:00
by pancakegh
fmw42 wrote:try adding -format jpg before the C:\...
Perhaps your input files have spaces at the beginning or some other hidden character?
As you can see by the screenshot in my original post, the files are named:
441.92.0052.jpg
441.92.0053.jpg
441.92.0054.jpg
441.92.0055.jpg
441.92.0056.jpg
441.92.0057.jpg
The original files are overwrited and there are an extra set of files created after the batch:
441.92.0052.jpg~
441.92.0053.jpg~
441.92.0054.jpg~
441.92.0055.jpg~
441.92.0056.jpg~
441.92.0057.jpg~
The extra files arent showing up as a picture in windows explorer. If I delete the ~ symbol in the filenames the files change into the orgiginal images where the batch first started.
It looks like mogrify overwrites the original files and makes a backup of the files by adding the ~ symbol... very strange.
Re: Mogrify keeps adding " ~ " to extension.
Posted: 2015-02-12T14:20:00-07:00
by snibgo
Do you have full read/write/delete access to the directory C:\Users\webdesign\Desktop\aanpassingen\2\ ?
Re: Mogrify keeps adding " ~ " to extension.
Posted: 2015-02-12T14:53:54-07:00
by pancakegh
Yes I am administrator and changed the folders by unticking read only.
Re: Mogrify keeps adding " ~ " to extension.
Posted: 2015-02-12T15:12:08-07:00
by Bonzo
Have you tried a simple resize and a separate -extent to see which may be causing the problem.
Have you tried a different jpg with a simple filename to see if the full stops could be causing a problem or if there is something wrong with your jpg images.
Re: Mogrify keeps adding " ~ " to extension.
Posted: 2015-02-12T16:04:56-07:00
by fmw42
Is there a hidden or extra character such as a space at the end of your filenames?
Re: Mogrify keeps adding " ~ " to extension.
Posted: 2015-02-12T16:22:34-07:00
by pancakegh
No hidden or extra characters.. I tried a simple -trim command. Same result. deleting the full stops doesn't help either. I think it has to do with the *.jpg format.. If I adress 1 file specifically the commands work well. But I need to batch convert all the images..
Re: Mogrify keeps adding " ~ " to extension.
Posted: 2015-02-12T16:39:04-07:00
by fmw42
Did you add -format jpg to your command? Did that help?
Is there a space at the end of your command after *.jpg?
I have never seen this issue before. It has worked fine for me. Try writing to a new empty directory using -path newdirectory in your command.
Re: Mogrify keeps adding " ~ " to extension.
Posted: 2015-02-13T01:32:12-07:00
by pancakegh
Adding -format jpg doesn't help. -format ".jpg" makes copies of the original but resized and added whitespace like it should:
441.92.0052..jpg
441.92.0053..jpg
441.92.0054..jpg
441.92.0055..jpg
441.92.0056..jpg
441.92.0057..jpg
But this time it adds a " . " to the end of the name. But not after the file extension, so the duplicated files are images.
If I do -format "jpg" or -format jpg , the results are the same, ending up with copies with " ~ " added to the filename.
I can't see any spaces behind the filenames. Writing to an empty directory doesnt do anything with the files..
ps: in this thread I see that magick brought out a beta version:
viewtopic.php?t=25683
I tried to find an .exe install but all I could find was version 7. So I installed that version and retried the mogrify from version 7, but still no luck
Re: Mogrify keeps adding " ~ " to extension.
Posted: 2015-02-13T10:23:45-07:00
by fmw42
But this time it adds a " . " to the end of the name
That is because you added a . in -format ".jpg". IM knows convert to whatever argument you specify by the name used. That is why you do not need the . in the -format argument
Re: Mogrify keeps adding " ~ " to extension.
Posted: 2015-02-13T10:54:29-07:00
by pancakegh
Yeah but in my last post I tried " -format jpg " and that still gave me the added " ~ ". I found a workaround for the problem. I was running cmd via Robotask and adding the commands as parameters for that task. Now I made a .bat file with the same code wich I execute via robotask and that works now. I think IM was somehow conflicting with Robotask wich outputted the wrong path/extension.