No, it's getting just the desired portion. Not that cropping is very difficult:
on cropTo:{x1, y1, x2, y2} fromPath:inputPath toPath:outputPath
set newWidth to x2 - x1
set newHeight to y2 - y1
set theImage to current application's NSImage's alloc()'s initWithContentsOfFile:inputPath
set theSize to (theImage's |size|()) as record
set oldHeight to height of theSize
-- transpose y value for Cocoa coordintates
set y1 to oldHeight - newHeight - y1
set newRect to {{x:x1, y:y1}, {width:newWidth, height:newHeight}}
theImage's lockFocus()
set theRep to current application's NSBitmapImageRep's alloc()'s initWithFocusedViewRect:newRect
theImage's unlockFocus()
set theData to theRep's representationUsingType:(current application's NSPNGFileType) |properties|:{NSImageGamma:1.0}
theData's writeToFile:outputPath atomically:true
end cropTo:fromPath:toPath:
Do not post admin requests to the list. They will be ignored.
applescriptobjc-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden