ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> image-sig
image-sig
[Image-SIG] PIL and out-of-bounds crop-coordinates
by Markus Meyer other posts by this author
Jun 22 2004 2:09PM messages near this date
[Image-SIG] $73221 | [Image-SIG] $91823
Hi everyone,

I'm using PIL 1.1.4 (on Linux and Windows) to do some extensive cropping
of images. I often have out-of-bounds crop parameters, e.g. say I have a
100x100 image and want to "crop" the image using the rect
(10,10,150,150). With these parameters, part of the image at the upper
left corner is cropped, but at the lower right corner, empty space is
added. Tests have shown that PIL does this correctly, but (not
surprisingly) adds random stuff at the "empty" places.

Is this use of crop legitimate? Can I be sure that no segmentation
faults or other exceptions occur when using crop this way? If yes, how
can I tell PIL which background it should use for the empty parts of the
newly created picture? If not, what simple solution would you suggest as
workaround?

Thanks in advance


Markus



_______________________________________________
Image-SIG maillist  -  Image-SIG@[...].org
http://mail.python.org/mailman/listinfo/image-sig

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved