I am having problems with an ExtendScript I am writing to be used by a collegue on a Windows computer. Everything runs fine on my MacOS computer but on her Windows machine the resizing works really wierd. Due to the Covid situation I don't have access to her computer for direct debugging.
I am using a resize statement like this:
But her output is an image that is 0.00694444444444 pixels. Is there a know issue with UnitValue on Windows or something. Do anyone have suggestions on workarounds or other things to try?
Photoshop cannot produce an image that is less than a pixel wide, so what exactly are the resulting image’s pixel dimensions?
Edit: What are the images’ resolutions?
Well, I am not sure as I not have access to the computer, but that is the output of doc.width * doc.height
The same output on my Mac is 625.
What are the resolutions of the images?
This is part of a larger process so the end image is not 0.00694444444444. What I do is reduce the size temporarly to do some analyzing that would otherwise be too time consuming. The input images may have varying sizes but are usually 1000x1000.
Have the resulting file sent to you and post it please.
Because I already stated a Photoshop-image-file cannot have less than 1px width … and »0.00694444444444 pixels« would be that.
I have actually had more trouble with scriptlistner code before when trying to build for others (at least when they had other PS versions) but that definitely is worth trying. Thanks for the suggestion!
Have you tried setting the rulerunits within the Script?
No, I haven't but that sounds like something worth doing!
It does indeed seem like Photoshop ignores the UnitValue setting and uses the rulerUnits setting instead when I do some tests on my computer so this is very promising.
Yes, that was it. Thank you!
Before changing the ruler units, it is generally a good idea to do this near the head of the script:
// Save the current ruler units var savedRuler = app.preferences.rulerUnits;
Then add this towards the tail of the script after changing the ruler units to px and doing your stuff:
// Restore the saved ruler units app.preferences.rulerUnits = savedRuler;
Yes, I have already implemented a similar restore in my script.