Image resizing via drag & drop

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Tabularas
Posts: 1
Joined: 20 Mar 2017, 09:52

Image resizing via drag & drop

20 Mar 2017, 10:18

Hello Folks,

At my work we are creating a pretty hefty amount of images in different sizes. To save some time and improve the workflow I wanted just to render the biggest size of the image and resize it by script into the needed sizes. I've searched some time now on the internet to find a solution to my problem and got to following possible solutions:

- batchscript via imagemagick
- batchscript via nconvert
- scripting via AutoHotkey (https://autohotkey.com/boards/viewtopic.php?t=2505)

I'm definitely not strong into scripting/coding and need help to get along my obstacles.

First of all I need to use relative paths. No absolute due to the fact that we are creating each day a lot of images and the paths are always changing (e.g. new File Version, Date, Folder etc.).

E.g.

I have following folder Structure

99165 --> media --> l (99165 is just one of a lot different foldernames due to the fact that they represent a different project)

What I want is that all Images from folder "l" will be resized into different sizes and put into the folders "m, s, xs". All of them need to have the same naming, so no renaming or additional suffix.

m --> image size 960x540
s --> image size 640x360
xs --> image size 240x135



Later on I want to also create an GUI that these image sizes could be customized but this is second priority till now.
I know I'm probably asking a lot but I could really use some help here.

Does anybody know if a all in one compiled .exe file is possible or will I be "restricted" to provide always additional converter (like imagemagick, nconvert etc.)

I would really appreciate any help.
garry
Posts: 3764
Joined: 22 Dec 2013, 12:50

Re: Image resizing via drag & drop

20 Mar 2017, 15:10

just short , an example with freeware irfanview , drag&drop picture and resize

Code: Select all

modified=20140225
;- irfanview drag&drop resize convert
;- http://www.irfanview.com/

extensions:="jpg,bmp,tif,png"
filename1=Irfanview_Drag&Drop convert resize
PR=%A_ProgramFiles%\IrfanView\i_view32.exe

Gui,2: Font, default, FixedSys
Gui,2:add,button  , x840 y15 h22 w100  gStart1       ,Start
Gui,2:Show, x50 y10 w970 h50,%Filename1%
Gui,2:add,edit    , x10 y10 h35 w820   vF1,Drag&Drop picture here
return

2Guiclose:
exitapp

start1:
Gui,2:submit,nohide
guicontrolget,F1
SplitPath, F1, name, dir, ext, name_no_ext, drive
If Ext Not In %extensions%
{
msgbox, 262192, Picture MESSAGE,Only pictures %extensions%
return
}

;-- resize a picture
new=%a_desktop%\%name_no_ext%_new.%ext%
aa=/resize=(800,0) /aspectratio /convert=%new%

;- convert to pdf -------
;new=%a_scriptdir%\%name_no_ext%_new.pdf
;aa=/convert=%new%

;- convert to ico -------
;new=%a_desktop%\%name_no_ext%_new.ico
;aa= /aspectratio /resize=(138`,0) /gray /convert=%new%
;aa= /aspectratio /resize=(138`,0) /convert=%new%

runwait,%pr% %f1% %aa%

ifexist,%new%
    run,%new%
return


2GuiDropFiles:
GuiControl,2:,F1
Loop, parse, A_GuiEvent, `n
   GuiControl,2:,F1,%A_LoopField%
return
;=============== end script ==============

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: doodles333, TheDewd and 273 guests