Hello,
I wondered if there's any coding wizards out there who could help me with something. When I use the PhotoshopToSpine Script to export my pngs, I need to make sure that the exported images dimensions are divisible by 16. Is there anyone who might know how to customise the Photoshop .jsx file to make this possible?
I tried this piece of code that a friend helped with & it seemed to work, however when using the [scale:number] layer tag it would not trim the alpha correctly -
preferences.rulerUnits = Units.PIXELS; with(activeDocument)
resizeCanvas(width + 16 - width % 16, height + 16 - height % 16)
I replaced this line of code in the original .jsx file here:
// Save image.
if (writeImages) {
scaleImage(settings.scale * scale);
if (settings.padding > 0) activeDocument.resizeCanvas(width * scale, height * scale, AnchorPosition.MIDDLECENTER);
So it would then read:
// Save image.
if (writeImages) {
scaleImage(settings.scale * scale);
if (settings.padding > 0) activeDocument.resizeCanvas(width + 16 - width % 16, height + 16 - height % 16);
If anyone can help with this, it would be amazing! I'll shower you with gifts! 😃
Many thanks, Plunksville