Reads GIF image from stream @param is containing GIF file. @return read status code (0 = no errors)
(InputStream is)
| 265 | * @return read status code (0 = no errors) |
| 266 | */ |
| 267 | public int read(InputStream is) { |
| 268 | init(); |
| 269 | if (is != null) { |
| 270 | in = is; |
| 271 | readHeader(); |
| 272 | if (!err()) { |
| 273 | readContents(); |
| 274 | if (frameCount < 0) { |
| 275 | status = STATUS_FORMAT_ERROR; |
| 276 | } |
| 277 | } |
| 278 | } else { |
| 279 | status = STATUS_OPEN_ERROR; |
| 280 | } |
| 281 | try { |
| 282 | is.close(); |
| 283 | } catch (Exception e) { |
| 284 | } |
| 285 | return status; |
| 286 | } |
| 287 | |
| 288 | /** |
| 289 | * Decodes LZW image data into pixel array. Adapted from John Cristy's BitmapMagick. |
no test coverage detected