[RÉSOLU] batch .EMF > 200% > .JPG ?

Questions générales en Français

Moderators: XnTriq, helmut, xnview

Ctrl-Alt-Suppr
Posts: 4
Joined: Fri Jan 15, 2016 7:55 am

[RÉSOLU] batch .EMF > 200% > .JPG ?

Post by Ctrl-Alt-Suppr »

Bonjour à tous.
Bon début d'année 2016.

Nouveau membre, j'aimerai connaitre la ligne de commandes à inscrire dans un .BAT
Pour pouvoir faire, si c'est possible, un drag & drop de fichiers .EMF afin qu'ils soient redimensionnés à 200% puis sauvegardés dans le même dossier, avec le même nom, au format .JPG

Oui ; je sais que Noël est passé, mais si une âme charritable passe par ici, ça serait sympa de me dégrossir le "travail" ^^
Par avance, merci.
:)
Last edited by Ctrl-Alt-Suppr on Mon Jan 18, 2016 11:01 am, edited 1 time in total.
cday
XnThusiast
Posts: 4176
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: batch .EMF > 200% > .JPG ?

Post by cday »

Ctrl-Alt-Suppr wrote:Bonjour à tous.

Nouveau membre, j'aimerai connaitre la ligne de commandes à inscrire dans un .BAT
Pour pouvoir faire, si c'est possible, un drag & drop de fichiers .EMF afin qu'ils soient redimensionnés à 200% puis sauvegardés dans le même dossier, avec le même nom, au format .JPG
Bonjour,

Can you read English? Prière de répondre en français… ? :wink:
Ctrl-Alt-Suppr
Posts: 4
Joined: Fri Jan 15, 2016 7:55 am

Re: batch .EMF > 200% > .JPG ?

Post by Ctrl-Alt-Suppr »

!?

Hi,

I have many files .EMF to be converted.
I shall like knowing the line of commands in a .BAT for:
- Enlarge in 200 % the size x, y of my files
- Register in .JPG
If possible, I would like making a drag and a drop EMF on the batch

Thank you in advance.
cday
XnThusiast
Posts: 4176
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: batch .EMF > 200% > .JPG ?

Post by cday »

I have code for a batch file .bat but have been testing it using a .wmf file, do you have an example .emf file you could upload to the forum, 2MiB maximum in a ZIP, or post online?
Ctrl-Alt-Suppr
Posts: 4
Joined: Fri Jan 15, 2016 7:55 am

Re: batch .EMF > 200% > .JPG ?

Post by Ctrl-Alt-Suppr »

EMF.zip
image @t .EMF format
(into a .Zip because EMF is not supported by forum)

8)
You do not have the required permissions to view the files attached to this post.
cday
XnThusiast
Posts: 4176
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: batch .EMF > 200% > .JPG ?

Post by cday »

Thanks, that image looks rather technical! :wink:

The following basic code run at the command line will convert a .emf file to JPEG with JPEG quality = 80 :

Code: Select all

nconvert -out jpeg -q 80 filename.emf
The following basic code run at the command line will convert all the .emf files in the Input folder into JPEG files in the Output folder with the same file names:

Code: Select all

nconvert -out jpeg -q 80 -o "C:\A\Output\%.jpeg" C:\A\Input\*.emf
When that code is run as a Windows batch file .bat the % symbol must be doubled to 'escape' the character:

Code: Select all

nconvert -out jpeg -q 80 -o "C:\A\Output\%%.jpeg" C:\A\Input\*.emf
In a 'drag and drop' action the input files are deleted, in this case after they have been read rather than moved, which can be achieved by adding -D to the code:

Code: Select all

nconvert -out jpeg -q 80 -D -o "C:\A\Output\%%.jpeg" C:\A\Input\*.emf
To resize the pixel dimensions of the output images by 200% the code -resize 200%% 200%% may be added to give the final batch file code you require:

Code: Select all

nconvert -resize 200%% 200%% -out jpeg -q 80 -D -o "C:\A\Output\%%.jpeg" C:\A\Input\*.emf
Note that due to a limitation on the use of quotes (" ") with wildcards (*) in NConvert, the following restrictions apply, as determined by my tests:

-Quotes may not be placed around the input term;

-The path to the file name of the input files must not contain any spaces, but the file name may contain spaces.

Any editing or other errors excepted... :wink:

In the event of any development work being required, testing may be simplified slightly by omitting the -D term until the code is otherwise working.

Test on a copy of your input EMF files!!
Ctrl-Alt-Suppr
Posts: 4
Joined: Fri Jan 15, 2016 7:55 am

Re: batch .EMF > 200% > .JPG ?

Post by Ctrl-Alt-Suppr »

I adapted to my repertory, and that works!
Great, thanks.
:mrgreen:
User avatar
XnTriq
Moderator & Librarian
Posts: 6387
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: [RÉSOLU] batch .EMF > 200% > .JPG ?

Post by XnTriq »

Great post, cday! That one went rrright to my bookmarks :D