Image Resizer

Hi,

I wonder if anyone can help me.

I am attempting to add a button to DOpus that will convert selected image files to 4000x4000 and 512x512. The code below shows the process which works fine. The problem I have is I need these resized images to be automatically moved to a new folder called "4000" and "512".

Any help would be much appreciated.

I am a very new used by the way.

Regards

Roly


Image CONVERT=jpg HERE ADDSUFFIX HEIGHT=4000 WIDTH=4000 PRESERVEASPECTRATIO
@NODESELECT

Image CONVERT=jpg HERE ADDSUFFIX HEIGHT=512 WIDTH=512 PRESERVEASPECTRATIO
@NODESELECT

You need to create folder first and replace HERE by TO argument...

CreateFolder "{sourcepath}\512"
Image CONVERT=jpg TO="{sourcepath}\512" ADDSUFFIX HEIGHT=512 WIDTH=512 PRESERVEASPECTRATIO
@NODESELECT

CreateFolder "{sourcepath}\4000"
Image CONVERT=jpg TO="{sourcepath}\4000" ADDSUFFIX HEIGHT=4000 WIDTH=4000 PRESERVEASPECTRATIO
@NODESELECT

[quote="AlbatorIV"]CreateFolder "{sourcepath}/4000"
Image CONVERT=jpg TO="{sourcepath}/4000" ADDSUFFIX HEIGHT=4000 WIDTH=4000 PRESERVEASPECTRATIO
@NODESELECT[/quote]

Thanks for the reply but it doesn't seem to work. This is my new code:

CreateFolder "{sourcepath}/4000"
Image CONVERT=jpg TO="{sourcepath}/4000" HERE ADDSUFFIX HEIGHT=4000 WIDTH=4000 PRESERVEASPECTRATIO
@NODESELECT

CreateFolder "{sourcepath}/512"
Image CONVERT=jpg TO="{sourcepath}/512" HERE ADDSUFFIX HEIGHT=512 WIDTH=512 PRESERVEASPECTRATIO
@NODESELECT

Now I get two new folder "4000" and "512" (good start) plus the converted files in the root folder rather than the new folders. Now, how do I get the resized files into the new folders...?

Regards

Steve

It's ok, I've cracked it now. I used a / instead of .

Problem solved, thanks very much for your help.

Regards

Steve

read my last post...

replace / by \ it's better and delete the HERE argument and it work...

[quote="AlbatorIV"]read my last post...

replace / by \ it's better and delete the HERE argument and it work...[/quote]

All sorted now, thanks again :slight_smile:

Hi guys,

Since creating this script I have discovered a flaw in it. When I create a folder I sometimes have the "Read new folder automatically" option checked. If the option is checked from the previous command then the script will not work. If I created a folder and uncheck the option then the script will work fine the next time it is run.

So, is there a command to switch the option off before running the script...?

Any help would be much appreciated.

Regards

Roly

I don't know if it's a bub but you can add this argument READAUTO=no

CreateFolder "{sourcepath}\512" READAUTO=no

You can learn more about createfolder command here : http://www.gpsoft.com.au/manual9/NetHelp/WordDocuments/createfolderrawcommand.htm

[quote="AlbatorV"]I don't know if it's a bub but you can add this argument READAUTO=no

CreateFolder "{sourcepath}\512" READAUTO=no

You can learn more about createfolder command here : http://www.gpsoft.com.au/manual9/NetHelp/WordDocuments/createfolderrawcommand.htm[/quote]

I should have read that in the first instance.

Thanks again AlbatorV, you're a good man :slight_smile: