Jump to content
Sign in to follow this  
cramaboule

Pics Converter

Recommended Posts

cramaboule

Hello all,

I was looking on the Internet to find a simple picture converter for a whole batch.

Guess what? I was amazed that I didn't find anything free. So I decided to write one in AutoIt! Here we are... Enjoy !

EDIT1: Misstypo

EDIT2: Added new Version !

EDIT3: Added V1.2 (bugs fixed)

Here is the New version 29/10/2009

Pics-Converter.au3

Edited by cramaboule

Share this post


Link to post
Share on other sites
Zedna

Nice and simple!

Tips for improvement: 

- autodetect input type

- set output file time according to input one

-  for JPG new option for "quality"

- remove Sleep(10) from FOR/NEXT loop

Note: There is freeware IrfanView tool for batch image conversions

Edited by Zedna

Share this post


Link to post
Share on other sites
cramaboule

Thanks for the comments !

- autodetect input type

I knew some one would make this comment !!!!! :idea:

- set output file time according to input one

'dont konw how to do that !!! :P

- for JPG new option for "quality"

Hummmmmm okay,...:)

- remove Sleep(10) from FOR/NEXT loop

I put this one just to see the progress bar...:) (to be able so see the progress bar moving !)

Note: There is freeware IrfanView tool for batch image conversions

Arrrr yes, but I am not a fan of IrfanView.:lol:

I see what I can make !

Cramaboule

Share this post


Link to post
Share on other sites
cramaboule

Look at FileGetTime() and FileSetTime()

Sorry, I misunderstood what you meant!!!

Okay Now I understand... I have put the same date and time as the originals ones...

Okay so... looks easy to do !!!

But why is the reason of doing that ???

Share this post


Link to post
Share on other sites
cramaboule

Nice and simple!

Tips for improvement:

- autodetect input type

- set output file time according to input one

- for JPG new option for "quality"

- remove Sleep(10) from FOR/NEXT loop

Note: There is freeware IrfanView tool for batch image conversions

Hi Zedna,

New version with your ideas of improvement !!! :)

Cramaboule

Share this post


Link to post
Share on other sites
Zepx

I'm getting this error,

---------------------------
AutoIt Error
---------------------------
Line 120  (File "D:\Autoit\Pics-Converter.au3"):

If IsDllStruct($TParam) Then $Param = DllStructGetPtr($TParam)
If IsDllStruct(^ ERROR

Error: Variable used without being declared.
---------------------------
OK   
---------------------------

Share this post


Link to post
Share on other sites
cramaboule

I'm getting this error,

---------------------------
AutoIt Error
---------------------------
Line 120 (File "D:\Autoit\Pics-Converter.au3"):

If IsDllStruct($TParam) Then $Param = DllStructGetPtr($TParam)
If IsDllStruct(^ ERROR

Error: Variable used without being declared.
---------------------------
OK 
---------------------------

Ah !!! Me too.... :)

It's happens when you convert from jpg to bmp for instance !!!

C.

Share this post


Link to post
Share on other sites
cramaboule

New version corrected on the first post !!!

Enjoy !!!

Cramaboule !

Share this post


Link to post
Share on other sites
aymhenry

WAW

I was locking for some program like that, I need to learn about the structure of of all those format.

I hope if it is possible also for videos & sound format wmv avi mpeg... etc.

Grate ...

Share this post


Link to post
Share on other sites
KeithDawn

Awesome script, I'm gonna us it the next time I unload my camera to the computer and don't feel like manually reducing 200 images to send to friends.

On a side-tangent though, does anyone know of a script that would allow someone to select a folder of images and randomize the names of all files within, without changing the files? It's probably easily done, just a way to rename mass files, only randomly to some degree, but the problem is I suck at coding.

Thanks anyway for the script.

Share this post


Link to post
Share on other sites
Skrip

Awesome script, I'm gonna us it the next time I unload my camera to the computer and don't feel like manually reducing 200 images to send to friends.

On a side-tangent though, does anyone know of a script that would allow someone to select a folder of images and randomize the names of all files within, without changing the files? It's probably easily done, just a way to rename mass files, only randomly to some degree, but the problem is I suck at coding.

Thanks anyway for the script.

Let's not take over this thread, but I can work on that for ya when I get home. When it's done, I'll start a new thread as to not screw up this one.


[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Share this post


Link to post
Share on other sites
QED

Hi Cramaboule

Just wanted to say thank you for a piece of code I found in your excellent example. It’s the part about setting gdi+ jpg encoder quality. I've modified the variable names to be analogous to the help file and reproduced it below.

; Set up parameters for 90% JPEG quality
$JPGQuality=90
$tData = DllStructCreate("int Quality")
DllStructSetData($tData, "Quality", $JPGQuality)
$tParams = _GDIPlus_ParamInit(1)
_GDIPlus_ParamAdd($tParams, $GDIP_EPGQUALITY, 1, $GDIP_EPTLONG, DllStructGetPtr($tData))

The AutoIt help file is brilliant and I managed to build almost my entire script just using the help. The problem was I didn’t have a clue how to modify the “90 degree rotation” example to “JPG Quality”.

Considering how low the default jpg quality is – your example should be used by everybody who needs to save a jpg. I hope the developers will consider using your example in the help file.

QED

Share this post


Link to post
Share on other sites
Dolemite50

Handy-dandy script here, great job!

The only problem I ran into was that it didn't seem to retain transparency in PNGs.

Beyond that, hat's off!

Share this post


Link to post
Share on other sites
cramaboule

Share this post


Link to post
Share on other sites
cramaboule

The AutoIt help file is brilliant and I managed to build almost my entire script just using the help. The problem was I didn’t have a clue how to modify the “90 degree rotation” example to “JPG Quality”.

Hum,... ;) you know I am not really the best one at DLL

Someone can Help Him ???

Cram...

Share this post


Link to post
Share on other sites
wazer

Would be nice if it could mass convert to given extension without selecting what extention your files are at first.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×