Picture Conversion

Features wanted...
Post Reply
aurumdigitus
Posts: 1075
Joined: 30 May 2008 21:02
Location: Lake Erie

Picture Conversion

Post 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)

RalphM
Posts: 1932
Joined: 27 Jan 2005 23:38
Location: Cairns, Australia

Re: Picture Conversion

Post 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?
Ralph :)
(OS: W11 22H2 Home x64 - XY: Current beta - Office 2019 32-bit - Display: 1920x1080 @ 125%)

aurumdigitus
Posts: 1075
Joined: 30 May 2008 21:02
Location: Lake Erie

Re: Picture Conversion

Post 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:

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: Picture Conversion

Post 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");
    }
One of my scripts helped you out? Please donate via Paypal

RalphM
Posts: 1932
Joined: 27 Jan 2005 23:38
Location: Cairns, Australia

Re: Picture Conversion

Post 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.
Ralph :)
(OS: W11 22H2 Home x64 - XY: Current beta - Office 2019 32-bit - Display: 1920x1080 @ 125%)

FluxTorpedoe
Posts: 855
Joined: 05 Oct 2011 13:15

Re: Picture Conversion

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

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: Picture Conversion

Post by highend »

Nice flux, never used savethumb before :titter:
One of my scripts helped you out? Please donate via Paypal

Post Reply