Jump to content

Pics Converter


cramaboule
 Share

Recommended Posts

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

EDIT4: New version V2.0.0.0: resizing ability !!!! 😊😇😁😎

EDIT5: New version: V3.0.0.0: Added WebP (from https://developers.google.com/speed/webp/download) and subfolder scan 😉

Pics-Converter.au3

Pics-Converterv2.au3

PicsConverterV3 (GitHub)

Edited by cramaboule
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 ???

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 2 weeks later...

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   
---------------------------
Link to comment
Share on other sites

  • 2 weeks later...

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.

Link to comment
Share on other sites

New version corrected on the first post !!!

Enjoy !!!

Cramaboule !

Link to comment
Share on other sites

  • 2 weeks later...

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.

Link to comment
Share on other sites

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]

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 4 weeks later...
Link to comment
Share on other sites

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...

Link to comment
Share on other sites

  • 3 years later...
Link to comment
Share on other sites

On 5/25/2013 at 9:59 PM, wazer said:

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

Yep... will do it. I thought the same making the version 3 !

Link to comment
Share on other sites

V3.0.1.0    02.06.2023:
- Improved: faster search with _ArrayConcatenate()
- Changed: -lossless can be used with -q (for WebP)
- Improved: faster conversion using -mt for WebP
            https://developers.google.com/speed/webp/docs/cwebp
- Improved: optimize decodig webp
            https://github.com/webmproject/libwebp/blob/0905f61c8511f080bec75ba98f67d53bb2906ccf/doc/tools.md
- Added: Decoders from GDI+
- Added: auto select input encoder

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...