FAQ
Cover
\
Build
\
Source
\
Bugs
\
Reference
\
Libraries
\
Tools
The bugs database has moved
here
.
Bug 217 : when loading gif images, you don't break on finding transparency
Last modified: 2005-11-22 08:14
P
roject:
processing
trash
Version:
unspecified
Co
m
ponent:
android
book
core
libraries
pde
reference
tools
web
Status:
RESOLVED
Resolution:
FIXED -
Pr
i
ority:
P4
Severity:
normal
Platform
All
O
S:
All
Windows
Mac OS
Linux
Other
Reporter:
jedierikb
Assigned To:
fry
Attachment
Type
Created
Size
Actions
Description
: Opened: 2005-11-21 19:20
version 95
in PApplet, in the loadImage method, you don't break out of your loop when
you find a transparent pixel.
here is the code:
// if it's a .gif image, test to see if it has transparency
if (filename.toLowerCase().endsWith(".gif")) {
for (int i = 0; i < image.pixels.length; i++) {
// since transparency is often at corners, hopefully this
// will find a non-transparent pixel quickly and exit
if ((image.pixels[i] & 0xff000000) != 0xff000000) {
image.format = ARGB;
}
}
}
return image;
}
Additional Comment
#1 From fry 2005-11-22 08:14
whups, fixed for 0096.