Resize pictures

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: Hacker, petermad, Stefan2, white

Post Reply
myki
Junior Member
Junior Member
Posts: 15
Joined: 2013-01-01, 20:45 UTC

Resize pictures

Post by *myki »

Hello,

I didn't know where to post this, so if i'm wrong, feel free to move it where you want :-)
I was looking for a way to easily resize selected pictures in TC.
Before i met TCBL and ImageMagick, i used a tool named "Image Resizer for Windows" : http://imageresizer.codeplex.com/

It installs a new folder in the right clic menu with the common sizes, and offers the possibility to use custom formats.
And it can be use everywhere, and in TC too.

Personnaly, i used TCBL and ImageMagick.

For the beginners, i did like that :
I installed TCBL (double clic in TC) and ImageMagick in the TC folder\Tools\ImageMagick.
I made a new button with :
Commande = %COMMANDER_PATH%\TCBL\tcbl.exe
Paramètres = %L convert -resize 1719 $f $x-resize.$e
(replace 1719 with your wished size)
Icon : %COMMANDER_PATH%\Tools\ImageMagick\images\wand.ico
(or use this one, converted in .ico).

I hope i helped :-)

PS : am i allowed to post urls ?
PS2 : is it possible to popup a window asking the size, with a default value inside ? (for me, 1719).
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3893
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Post by *sqa_wizard »

is it possible to popup a window asking the size, with a default value inside ? (for me, 1719)
Sure, just use a "?" in front of the parameter

Code: Select all

Paramètres = ?%L convert -resize 1719 $f $x-resize.$e
#5767 Personal license
myki
Junior Member
Junior Member
Posts: 15
Joined: 2013-01-01, 20:45 UTC

Post by *myki »

thanx a lot for your answer.
It works, but it asks the whole command line.
I would prefer that it asks only the size.
Possible ?
User avatar
nsp
Power Member
Power Member
Posts: 1913
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Post by *nsp »

myki wrote:thanx a lot for your answer.
It works, but it asks the whole command line.
I would prefer that it asks only the size.
Possible ?
You can use askparam to launch tcbl like this if installed in tools folder:

Code: Select all

Commande = %COMMANDER_PATH%\tools\askparam
Paramètres = /w /t"1509" /p"Size"  %COMMANDER_PATH%\TCBL\tcbl.exe %L convert -resize %%1 $f $x-resize.$e
In next version of TCBL i will include a small app to get paramters.

[EDITED] /w must be passed in order TC do not delete temporary file (%L) while TCBL read it. /t must be set before /p
Last edited by nsp on 2013-01-07, 08:16 UTC, edited 1 time in total.
myki
Junior Member
Junior Member
Posts: 15
Joined: 2013-01-01, 20:45 UTC

Post by *myki »

Thanx for your help, nsp :-)
I am happy that a solution exists to ask a param.
Your solution worked after i doubled the "%" in parameters :

Code: Select all

Commande = %COMMANDER_PATH%\tools\askparam
Paramètres = /w /p"Size" /t"1509" %%COMMANDER_PATH%%\TCBL\tcbl.exe %L convert -resize %%1 $f $x-resize.$e
To be perfect, just the default value doesn't work, i will take a look tomorrow, or if you know the solution i will take it :-)
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

myki, you should set default value before you ask for next parameter, so it should be written as /t"1509" /p"Size" exactly in this order. Parameter /t directly sets new text for text field and then parameter /p waits for the user action.
User avatar
kesdoputr
Member
Member
Posts: 168
Joined: 2007-12-27, 12:38 UTC

Post by *kesdoputr »

If i use askparam and my Paramètres have to use % and %%, how should i do?

for example i want to send 90% 90% to nconvert and 90 is a variable that i will input,
so i write -resize %%1% %%1% , but it can't work and nconvert just receive 90 90,thx for your reply. :D
User avatar
nsp
Power Member
Power Member
Posts: 1913
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Post by *nsp »

kesdoputr wrote:If i use askparam and my Paramètres have to use % and %%, how should i do?

for example i want to send 90% 90% to nconvert and 90 is a variable that i will input,
so i write -resize %%1% %%1% , but it can't work and nconvert just receive 90 90,thx for your reply. :D

If it is inside TC you should double the % sign and as it is passsed by command line you should also double each % sign and als double as is is also executed inside batch file that means that you should write:

Code: Select all

-resize "%%1%%%%%%%% %%1%%%%%%%%"
Yep ...
User avatar
kesdoputr
Member
Member
Posts: 168
Joined: 2007-12-27, 12:38 UTC

Post by *kesdoputr »

nsp wrote:
kesdoputr wrote:If i use askparam and my Paramètres have to use % and %%, how should i do?

for example i want to send 90% 90% to nconvert and 90 is a variable that i will input,
so i write -resize %%1% %%1% , but it can't work and nconvert just receive 90 90,thx for your reply. :D

If it is inside TC you should double the % sign and as it is passsed by command line you should also double each % sign and als double as is is also executed inside batch file that means that you should write:

Code: Select all

-resize "%%1%%%%%%%% %%1%%%%%%%%"
Yep ...
I found that when i use %%1%%%% can solve my problem

Thx for your reply :D
iana
Senior Member
Senior Member
Posts: 345
Joined: 2010-07-27, 22:00 UTC

Post by *iana »

A big tanks to nsp for his useful utility but why don't you try/use totalrsz for image resizing?

http://www.totalcmd.net/plugring/rsz.html

it uses GraphicsMagick a fork of ImageMagick for Image processing and it has a useful pack gui for choosing your settings.
Post Reply