sips for padding

So I have this applescript... (from this great site http://www.macosxautomation.com/applescript/imageevents/05.html )


set this_file to choose file without invisibles

-- indicate the proportions for the pad area

set H_proportion to 1000

set V_proportion to 1000

try

tell application "Image Events"


-- start the Image Events application


launch


-- open the image file

set this_image to openthis_file


-- get dimensions of the image

copy dimensions of this_image to {W, H}


-- calculate pad dimensions

if H_proportion is greater than V_proportion then

set the new_W to (H * H_proportion) / V_proportion

set pad_dimensions to {new_W, H}

else

set the new_H to (W * V_proportion) / H_proportion

set pad_dimensions to {W, new_H}

end if


-- perform action


padthis_imageto dimensionspad_dimensions--with pad color {65535, 65535, 65535}


-- save the changes


savethis_image with icon


-- purge the open image data


closethis_image

end tell

on error error_message

display dialogerror_message

end try

It works great (kinda!) It will get the current image dimensions and make it square with some padding. The issue? The padding is black. Seems to be a bug in the Image Events app

So I wanna replace this

padthis_imageto dimensionspad_dimensions--with pad color {65535, 65535, 65535}


With something like this


do shell script "sips " & this_file & " -p " & new_H & space & new_W & space & "--padColor FFFFFF" & space & "-i"


So I can get a white background with my image.


I just cant seem to work out the format. Any ideas?


Cheers

Posted on Jul 4, 2014 12:15 AM

Reply
2 replies

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

sips for padding

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.