Summary: | ImageLoader does not leave stream in readable state | ||
---|---|---|---|
Product: | [Eclipse Project] Platform | Reporter: | Mark McLaren <mark.k.mclaren> |
Component: | SWT | Assignee: | Platform-SWT-Inbox <platform-swt-inbox> |
Status: | NEW --- | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | CC: | carolynmacleod4, remy.suen |
Version: | 3.4 | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Whiteboard: |
Description
Mark McLaren
2008-04-15 18:39:44 EDT
Some notes: - I tried adding the following code to the end of JPEGDecoder.loadFromByteStream(InputStream inputStream, ImageLoader loader) (right before the ImageData is returned) if (cinfo.bytes_in_buffer > cinfo.bytes_offset) { /* Try to unread any buffered data past EOI. */ if (cinfo.inputStream.markSupported()) { try { cinfo.inputStream.reset(); cinfo.inputStream.skip(cinfo.bytes_offset); } catch (IOException e) { //SWT.error(SWT.ERROR_IO, e); } } } I thought this would do it, but it seems that the inputStream, which is an org.eclipse.swt.internal.image.LEDataInputStream, does not implement reset() and skip(n) so this code doesn't do anything. Note: also need to return true in markSupported() if these methods are implemented. I don't have time to take this further at the moment, so I'm just making these notes for when I revisit this in future. (If you'd like to try implementing and testing this and submitting a patch, that would be great!) This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. |