Ticket #349 (Fixed)Wed Aug 07 07:59:00 UTC 2013
Add support to SpriteExtend for JPEGs with interlace.
Reported by: | Chris Gransden (337) | Severity: | Enhancement |
Part: | RISC OS: Module | Release: | |
Milestone: | Status | Fixed |
Details by Chris Gransden (337):
JPEGs with interlace seem to be increasingly more common particularly in Word documents.
Here’s example JPEG with interlace. http://www.svrsig.org/images/image1.jpeg
Changelog:
Modified by Sprow (202) Wed, August 07 2013 - 21:57:00 GMT
This work has already been started (a while back) as noted on the http://www.riscosopen.org/wiki/documentation/sh… roadmap.
Progressive JPEG support is actually quite tricky because SpriteExtend keeps the JPEG blocks (usually 8×8) in their compressed form in strips in memory with bookmarks to the start of each strip for fast hunting through the compressed stream. These are decoded on the fly when redrawing (eg. scrolling round in !Draw).
With an progressive JPEG the blocks are rearranged into ascending frequency order (lowest frequency content arrives first giving the coarse outline earliest) which doesn’t fit into the strip bookmark scheme. All ROL’s Select did was to transcode the progressive JPEG back to a baseline JPEG via a second module, which is then fed into SpriteExtend as before.
The IJG8 work also gets you arithmetically coded JPEG support, which is nice.
It’s worth remembering that ChangeFSI has a newer (IJG6 rather than IJG4) decompressor and can handle progressive JPEGs. As it also exports (baseline) JPEGs you can use that to flatten them out or a port of the command line tool ‘jpegtrans’ would do.
I’m not sure I follow the “particularly in Word documents” comment. Word has no reason to interlace since the whole (Word) file is already in memory, and interlacing doesn’t make the file and smaller.
Modified by Chris Gransden (337) Wed, August 07 2013 - 23:11:25 GMT
The comment about word documents is to do with doc/docx import in easiwriter/techwriter. These use spriteextend to display the jpegs. the documents fail to import if there is a jpeg with interlace.
Modified by Sprow (202) Fri, August 09 2013 - 20:01:41 GMT
My point was only one of clarity for the purposes of the ticket. Word documents in themselves aren’t making progressive JPEGs any more or less common.
I created a test document today in Word 2007 with two copies of a JPEG in it (one pasted from Google images, the other recompressed to 96dpi within Word) it opened fine with TechWriter 9.10 and neither were interlaced.
Modified by Chris Gransden (337) Sat, August 10 2013 - 08:09:59 GMT
I was thinking more along the lines of word users including progressive JPEGs in documents without realising.
Modified by Sprow (202) Fri, June 03 2016 - 11:09:21 GMT
- Status changed from Open to Fixed