Command to resize pictures with windows plugin?

I am new to Opus and I have to admit this is a great program.

I use the ImageResizerPowertoy and with a right-click I get an option "Resize Pictures".

My question is:
Is there any way to auto resize my pictures?
Any chance to integrate this in a button for auto resize with a custom size? :question:

Opus has its own image conversion/resize/rotate tool which you can use to create buttons which do resizing in a single click.

If you run the Image CONVERT command with no additional arguments then it will pop open a dialog where you can specify what should be done to the selected images.

However, if you give it some more arguments you can create a button which resizes (etc.) the selected images in a single click.

For example:

Image CONVERT=jpg HERE ADDSUFFIX HEIGHT=128 WIDTH=128 PRESERVEASPECTRATIO

The above command would take the selected images and convert them into JPEGs in the same directory, resized to fit into a 128x128 square, with filenames adjusted to indicate the new sizes (so the original files aren't overwritten).

To learn more, have a look at the Image command in the manual.

OK thanks for the responce.

I try to create a button for the covers of my music collection to automatically copy,rename to folder, resize and hide the front cover. This is what I use so far:

Copy HERE
Rename TO folder.jpg
SetAttr SETATTR=H
Image CONVERT=jpg HERE ADDSUFFIX HEIGHT=128 WIDTH=128 PRESERVEASPECTRATIO
@NODESELECT

How do I change the first command to do the first 2 steps automatically, so that no window pops-up? And can I get both dimensions of the picture at least 128 pixels (min width or length 128 pixels)?

A suggestion: How about to list some common used buttons like this one?
I am sure we will come up with a nice collection of buttons used by the common user.

Another question: Is it possible to show the hidden files as in windows explorer (not 100% transparent?). I searched but Opus either shows them or not.

Try this:

runmode hide Image CONVERT=jpg HERE AS cover.jpg HEIGHT=128 WIDTH=128 PRESERVEASPECTRATIO sync: attrib +H folder.jpg
Make sure the type is set to MS-DOS Batch Function so that the attrib command works.

I don't think there's a way to specify minimum width/height; the PRESERVEASPECTRATIO turns them into maximum width/height, while not using it means they're absolute width/height and the image may be distorted. You could send GPSoft a feature request as I imagine it would be easy to add. Double-check the documentation of the Image function first, though, as I may be forgetting something.

That's what the Buttons and Tutorials forums are for. Feel free to post there once you're happy with the button. There are also a bunch of buttons examples in my Getting to know... Tutorial.

Have a look at this thread and also the Folder Formats FAQ if you haven't already read it.

By the way, if you've got ImageMagick (free) installed then you might get slightly better results by using it instead of Opus to resize the image.

The image scaling in Opus works very well but, when resizing to very small images (e.g. 100x100) I found that ImageMagick's extra filtering produced slightly better results. Not surprising given ImageMagick is a dedicated image editor. :slight_smile:

It's not really worth downloading ImageMagick just for this, but if you happen to have it already then you might as well use it. Here's the button:

runmode hide convert.exe -resize 128x128 {filepath$} folder.jpg attrib +H folder.jpg
Again, it should be set to the MS-DOS Batch Function type. If convert.exe isn't in the path then you should give the full path to it.

It may also be worth mentioning that you don't need to pre-scale folder.jpg if Opus is the only thing that will be displaying it. Opus has its own icon cache where a scaled version will be stored to avoid recalculating it every time.

The first command works, but I get 2 files with the names "cover" and "folder 128 x ...".
I want to get only 1 file with the name folder.jpg.

About the hidden files: I've already read many of the topics here but couldn't find anything about semi-transparency.

Sorry, change the "cover.jpg" in the function to "folder.jpg". I missed it while I was copying from a slightly different button.

Regarding hidden files, what exactly do you want to do? I think I misinterpreted what you were asking before.

Ok with this button

runmode hide Image CONVERT=jpg HERE AS cover.jpg HEIGHT=128 WIDTH=128 PRESERVEASPECTRATIO sync: attrib +H folder.jpg

I get the folder.jpg but it is not hidden and after that I receive an error message that the folder.jpg already exists. :unamused:

About the hidden files: In the windows explorer you can choose to show or hide the hidden files, BUT the hidden files then appear semi-transparent as when you cut a file.

It works fine here. Here's the full XML version.

Copy it to your clipboard, then enter Customize mode in Opus, right-click an empty area on your toolbar and select Paste.

<?xml version="1.0"?> <button display="both" effect="gray"> <label>Convert selected image to hidden folder.jpg</label> <icon1>84</icon1> <function type="batch"> <instruction>runmode hide</instruction> <instruction>Image CONVERT=jpg HERE AS folder.jpg HEIGHT=128 WIDTH=128 PRESERVEASPECTRATIO</instruction> <instruction>sync: attrib +H folder.jpg</instruction> </function> </button>

If a folder.jpg already exists then you should be asked if you want to replace it. Just click Replace and it'll be overwritten. If you're getting the Replace? dialog but you can't see an existing folder.jpg it's probably because you're hiding hidden files.

It may take a second or two for the display to update to show that the file is hidden but that part always seems to work for me as well.

Hidden files are shown as semi-transparent in Opus similar to Explorer. I don't think there's an option to change this; it should always happen as far as I know. (If it isn't happening, which OS are you using?)

Ok this button works! Thanks! :smiley:

I have Win XP SP2 (GR), but hidden files appear exactly as any other files (=not semi-transparent).
Any way to fix this? :confused:

Can you post a screenshot showing a hidden file along with a non-hidden file of the same type?

@Nudel

I tried your button (great idea BTW), I noticed that a Folder.jpg with a size of 128x128 is not enough to take up the whole size of the Opus folder thumbnail.

I played around, copying various sized images to make them Folder.jpg and saw that Opus will re-size very large Folder.jpg files to fit into about 95%-98% of the area of the Folder thumbnail.

Q: What is the final image size Opus displays Folder.jpg or Coverart.jpg at, when they are respectively displayed within a Folder thumbnail or a CD Case thumbnail?

I want to modify your button above to those dimensions, because I prefer that my Folder.jpg take up the whole folder thumbnail "canvass" space.

Okay I've Think I've got it now.

I played around with your button a bit, resizing an image which is very large down to various Folder.jpg sizes.

It seems that Opus will not use more than around 240 x 240 inside of the Folder thumbnail (which I'm guessing is 250 x 250). There is always some folder "border" showing around all four sides of the folder.jpg image. It looks like sizes below 240 x 240 increase this folder "border" size.

NOTE: When the thumbnails are resized with the Thumbnail Sizer, the Folder.jpg size does not come into play at all, because Opus resizes the display of the whole Folder thumbnail proportionally, to include the Folder.jpg displayed on it.

It probably depends on whether you have dynamic thumbnail sizing enabled. If it is then Opus tends to cache 256x256 versions of images, then scale them down as required; if it's disabled then the cached images are the current thumbnail size.

I'm not sure exactly what happens with folder thumbnails, though.

I noticed something about the semi-transparency for hidden files:
Opus shows the files semi-transparent in details-mode but not in list-mode.
I was looking in the settings but I can't find a way to make them semi-transparent in all modes.

BTW I try to hide ALL file extensions but I can't make it work. The best I achieved was to hide them in details mode. But I want to hide them in all modes... :unamused: