Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
I have many duplicates of the converted images.
I have no problems when a single file, the problem exists only when I have two or more files.
I have tried many and many files, I tried to insert "-duplicate 0" but the problem is the same.
You cannot use wild cards for the output when you use wild cards for the input with convert. If you want to process a whole folder or set of file, then use mogrify rather than convert. See https://imagemagick.org/Usage/basics/#mogrify It is designed for batch processing. If you do not want to do that, then you will have to write a script loop over each of your input images and use convert to process each one, one at a time.
One last question a bit off topic:
From the terminal I can convert all the files in the folder, if I insert the same code in a .sh file it won't work if I start it from the wordpress plugin. I mean that the whole .sh file is loaded correctly, only the "imagemagick" line is not.
Why? Problem with permissions?
Sorry, I do not know Wordpress. So I cannot answer your question. Perhaps ask on a Wordpress forum? Just guessing, but perhaps from Wordpress, you might need put the full path to convert. Otherwise, perhaps show us your script.
Of course, here is my script.
The "exiftool" command and the "mediafromftpcmd.php" file are executed correctly, unfortunately the "mogrify" (or "convert") no command.
Thanks anyway for your help. You're very kind.
Marco
Your mogrify command is wrong. See http://www.imagemagick.org/script/mogrify.php . Mogrify does not take both input and output filenames. It takes one filename (with wildcards) that is for input and also, by default, for output.
the line
exiftool -r -d %Y_%m_%d_%H%M%S.%%e "-filename<filemodifydate" /var/www/html/wp-content/uploads/img/
is managed by Exiftool, not by imagemagick
Why is it wrong?
Works properly from "Terminal"
The conversion from cmyk to rgb works, the maximum pixel size works, and I think the quality setting works.
You cannot use wild cards for input and output in mogrify. Look at the documentation for the syntax. See my link above.
change directory to inputfolder
mogrify <processing commands only> *
That will get each image from the current directory, process it and write over it with the output. So the * means both input and output. If you want to write to another directory for the output, then create it beforehand and specify it with -path outputdirectory
I tried to insert the .sh file with the code
mogrify -profile /var/www/html/cmyk.icc -profile /var/www/html/srgb.icc -quality 70 -resize 680
(also: magick mogrify -profile /var/www/html/cmyk.icc -profile /var/www/html/srgb.icc -quality 70 -resize 680 )
in the folder where there are images (without inserting the directory) but it does not work.
I tried my command line from Terminal and it works.
I don't think it's the command line's fault but permission...
You don't think??
You have to put * at the end of your mogrify command for it to get the input images from the current directory. It will then write over those images. So be sure you have a backup.