File operations inside ZIP files

Here's the contents of a button I wrote to perform some simple operations on a selected image file.

Image ROTATE=270 HERE REPLACE PRESERVEDATE
"C:\Program Files\ImageMagick\mogrify.exe" -resize x1500 {filepath$}
@nodeselect

It doesn't work if the image file is inside a ZIP file, however -- the executed file doesn't get copied back into the ZIP file from the TEMP directory. How can I make it work when selecting the (zipped) filename from inside the image viewer?

Your Button will work fine if you use DOpus to resize the image instead of an external tool. Try this:

Image WIDTH=1500 ROTATE=270 PRESERVEASPECTRATIO PRESERVEDATE REPLACE=always HERE From inside the Image Viewer you'll have to use the Image convert dialog from the context menu but the Image Viewer also creates a temporary Zip-file and saves the modified Image there.

My apologies. For simplicity's sake, I left out a portion of the ImageMagik command line. The full version is actually:

"C:\Program Files (portable)\Comics Curator\ImageMagick\mogrify" -strip -density 150 -resize x1500 -quality 50 *.jpg {filepath$}

As you can see, I also need ImageMagick to resample the image file, which as I understand it, the Dopus resizer can't do.

It occurs to me that I don't actually need to switch to the Image Viewer -- I can make my selections using Thymbnail View in a regular lister.

I don't have ImageMagick installed to test it but what you can try is to copy the file outside the Zip-file and copy it back afterwards. Try something like this:

Image ROTATE=270 HERE REPLACE PRESERVEDATE Copy TO /temp "C:\Program Files (portable)\Comics Curator\ImageMagick\mogrify" -strip -density 150 -resize x1500 -quality 50 "/temp\{file}" Copy "/temp\{file}" HERE WHENEXISTS=replace

Hmmm. Still won't copy the processed image back into the ZIP file, although everything else gets accomplished except that last step.

I should add that if I try your method on an image file not inside a ZIP container, it does copy the processed image back from the temp folder. It just won't put it back in the ZIP file.

I tried my code with nconvert with the same result. It doesn't work with files inside a Zip File. There seems to be a problem with {file} not transferring the filename of the zipped file to DOpus but the name of the temporary *.dop file or something like that. I couldn't find a way to get around this. We'll have to wait if leo or someone else knows a solution.

Normally, using {file} or similar within an archive or FTP site will copy the file to a temp dir and use that instead. That has to happen since external programs obviously cannot (usually) work on paths that aren't real files. (The filename will be the same, so {file} still generates exactly the same result, but you'll be needlessly extracting it to temp, twice in this case since you're also copying it to temp.)

You can use @nolocalizefiles to prevent that from happening.

Many thanks leo!
My Button Code is working fine now with @nolocalizefiles.