Page 1 of 1

Picture Conversion

Posted: 17 May 2019 20:38
by aurumdigitus
This may be pushing the envelope of what a File Manager can or should do. However, since XY how has so many features pertaining to graphics how about one more?

In particular a way to convert PNG files to JPG. Note this a very specific conversion and not a request to convert anything to everything. 8)

Re: Picture Conversion

Posted: 18 May 2019 07:16
by RalphM
What's wrong with using one of the command line versions of tools like Irfanview or ImageMagick and write a one-liner that does this trick?
While your wish is very specific and might be simple to accomplish, I'm sure there are hundreds more out there that would be just as legitimate, don't you think?

Re: Picture Conversion

Posted: 20 May 2019 15:38
by aurumdigitus
@ RalphM - Thank you for reading and taking the time to respond.
there are hundreds more out there that would be just as legitimate, don't you think?
Agreed; your point cannot be disputed.
What's wrong with using one of the command line versions of tools like Irfanview or ImageMagick and write a one-liner that does this trick?
As you may have gleaned by reading my thousand posts over a decade Scripting is a gift not bestowed upon me. :cry:

Re: Picture Conversion

Posted: 20 May 2019 16:10
by highend

Code: Select all

    $magick = "<path to>\ImageMagick\magick.exe";
    foreach($item, <get SelectedItemsPathNames |>, , "e") {
        if (exists($item) == 2) { continue; }
        runret("""$magick"" mogrify -format jpg ""$item""");
        status "Processing: " . gpc($item, "file");
    }

Re: Picture Conversion

Posted: 21 May 2019 03:37
by RalphM
@aurumdigitus - Yes I was aware of your dislike (or whatever we want to call it) of scripting but as highend just proved, there are scripters out there eager to help.

Re: Picture Conversion

Posted: 21 May 2019 10:03
by FluxTorpedoe
Salve, Aurumdigitus,

Well, XYplorer by itself can already answer your specific need, without the need for an external program—but still with a tiny bit of scripting… (And undoubtedly, it won’t be as flexible as highend’s solution.)

So, here’s a no-failsafe barebone solution (it’s been a while since I played code-golf!), that you can use directly or store in your user scripts.

• Select a bunch of your image files to convert, paste this in the address bar, press Enter, and voilà!

Code: Select all

::foreach($item, <selitems |>){savethumb($item,"* ","100%",,"jpg100")}
The images will retain their original name "* ", original size "100%", and will be saved at the highest quality "jpg100".

Re: Picture Conversion

Posted: 21 May 2019 11:14
by highend
Nice flux, never used savethumb before :titter: