Feature rquest: easy way to recompress photos

Features wanted...
Post Reply
mwb1100
Posts: 213
Joined: 19 May 2007 06:20

Feature rquest: easy way to recompress photos

Post by mwb1100 »

I often have some image that I want to send in email or post on a forum that I'd prefer to be in the 50 to 200KB size - these are things that often don't need a lot of detail. I just want to get some idea across (for example - sometimes it's a picture of a image of a diagram on a whiteboard). I'd like to be able to recompress these photos easily. I'm currently using "FILEminimizer for Photos a free, cut-down version of the FILEminimizer suite. It's not too bad, but I find it a little bit clunky; it also nags me to buy the suite. And I don't do this everyday, so honestly when I do want to use it I have to search around the start menu to find the program because I can't remember what the name of the damn program is.

I'd like an easy way to for example, right-click on a jpg (or several jpgs) and just recompress the images. Ideally, I could give a general size range. The original would need to be kept/backed-up in some fashion - just giving a new name in some form to the recompressed output would be fine for that.

Anyway, if XY could do this that would be great. If that's not in the cards, I'd appreciate suggestions from anyone who might know of a utility I could use that might be an alternative to FILEminmizer.

bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: Feature rquest: easy way to recompress photos

Post by bdeshi »

Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Stef123

Re: Feature rquest: easy way to recompress photos

Post by Stef123 »

I have set up a bunch of CTB dropdowns for Sammay's suggestion, such as:

Code: Select all

"Resize to 1100|<xyicons>\Ruler.ico"
 $MySelection= get(countselected,a);
    end $MySelection==0, "Nothing selected .... Dude. Start over.";
    $NameNew = input("New Name for my resized pics?");
   status "I am working on it .... Hold on....","FF0095","progress";
   foreach($item,<get selecteditemspathnames>,<crlf>) {
     runret("cmd /c <xypath>\..\XnUtilities\NConvert\nconvert.exe -o ""D:\_Out_Stuff\$NameNew#.jpg"" -ratio -resize 1100 0 ""$item""");
      };
   status "Done. All Pics got resized";   
   msg "Done. Go to _Out_Stuff to check up on it";
Note that my paths are hard-wired, you have to adapt them to your environment.

If someone would improve my - probably clumsy approach - I'd welcome that. It's excruciatingly slow on large selections.

bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: Feature rquest: easy way to recompress photos

Post by bdeshi »

nconvert is the cmdline version of XNConvert, better suited for our scope. (thanks Stef!)
Here's it's link: http://www.xnview.com/en/nconvert/#downloads
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Stef123

Re: Feature rquest: easy way to recompress photos

Post by Stef123 »

If it's about image dimensions only, you could proabably use an XY command:

Code: Select all

savethumb(, "*_small", 800);
However, turns out it gets the orientation wrong on some pics I tested it on. Whereas nconvert gets it right always, so you may better stick with nconvert, to be on the safe side.

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Feature rquest: easy way to recompress photos

Post by admin »

I use savethumb() daily for email attachments. No problems yet. Got an example for issues with orientation?

Stef123

Re: Feature rquest: easy way to recompress photos

Post by Stef123 »

I am at a different machine atm. Maybe it has to do with fast thumbnails, I also had regular thumbnail orientation problems that did not occur with smooth or crisp, but cannot check up on it now. Will try later to change the EXIF orientation manually and see how this affects savethumb()

BTW, does it rely on the method set in configuration? Could you add a paramter that allows to choose fast, smooth, or crisp?

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Feature rquest: easy way to recompress photos

Post by admin »

No, it's always the highest quality (smooth).

Stef123

Re: Feature rquest: easy way to recompress photos

Post by Stef123 »

Good enough. And good to know.

When I run the following on any pic

Code: Select all

   foreach($item,<get selecteditemspathnames>,<crlf>) {
     runret("cmd /c <xypath>\..\EXIFTool\exiftool.exe ""-Orientation=8"" ""-n"" ""-overwrite_original"" ""-P"" ""$item""");
      };
I can cause a similar problem when using savethumb.
Whereas running my nconvert script on the exif-rotated image works fine.

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Feature rquest: easy way to recompress photos

Post by admin »

OK, bug confirmed and fixed.

mwb1100
Posts: 213
Joined: 19 May 2007 06:20

Re: Feature rquest: easy way to recompress photos

Post by mwb1100 »

Thanks for everybody's help & suggestions on this. It looks like I may have to finally figure out how scripting works, but until I get around to that, the little one liner:
Stef123 wrote:If it's about image dimensions only, you could proabably use an XY command:

Code: Select all

savethumb(, "*_small", 800);
attached to a toolbar button gets the job done much easier than what I've used before. It seems that I'll need to look at the more complex scripts to be able to have the button handle more than one selected jpg at once. In the meantime, I do this only occasionally, so one at a time still works nicely.

Thanks again! :tup:

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

Re: Feature rquest: easy way to recompress photos

Post by highend »

the more complex scripts to be able to have the button handle more than one selected jpg at once

Code: Select all

    foreach($file, "<get SelectedItemsPathNames |>") {
        if (getpathcomponent($file, "ext") == "jpg") {
            savethumb(, "*_small", 800);
        }
    }
One of my scripts helped you out? Please donate via Paypal

Post Reply