TIP: Click on subject to list as thread! ANSI
echo: os2user-l
to: All
from: Mike O`Connor
date: 2004-09-29 19:50:08
subject: Re: JFIF comment blocks

Sid Gale wrote:

>As far as I can tell, it works like this:
>
>Every JPEG file starts with a marker 1-byte 'FF'x, 1-byte 'D8'x and ends 
>with a marker 1-byte 'FF'x, 1-byte 'D9'x. In between are various 
>self-contained segments which define the image.
>
>Each segment consists of:
>
>1-byte 'FF'x
>1-byte 
>2-bytes 
>Length-bytes data (the length includes the 2 length bytes, but not the 2 
>previous (marker) bytes)
>
>The segment type for the comment is 'FE'x, so the comment segment starts 
>with 2-bytes 'FFFE'x, followed by 2-bytes , which is the length 
>of the comment plus 2 (for the length bytes themselves). The comment is 
>not nul-terminated; it doesn't need to be as its length is known.
>
>It doesn't seem to matter what order the segments are in, as they seem 
>to be self-contained. Just make sure that, if you have to add a comment 
>segment, you put it between two segments and not in the middle of one! 
>If you are just editing an existing comment segment, remember to adjust 
>its length field. Using a hex editor, I tried inserting a comment (into 
>a file that didn't have one) immediately after the 'FFD8'x marker and 
>PMView read it, and showed the comment, without any problems. It should 
>be straightforward to write a rexx script to add/edit comments.
>
>Regards
>
>Sid Gale
>

Hi Sid,

Well that's a nice consistent logical way to organise the format, and 
easily understood. A piece of pie in my editor, can even automate the 
procedure from file-open to file-close!

-- 
Regards,
Mike

Failed the exam for
--------------------
MCSE - Minesweeper Consultant and Solitaire Expert
--------------------
[ISP blocks *.exe, *.cmd, *.bat, *.reg attachments]
[Please use zipped versions of above]



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/E8folB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

 To visit your group on the web, go to:
    http://groups.yahoo.com/group/os2user/

 To unsubscribe from this group, send an email to:
    os2user-unsubscribe{at}yahoogroups.com

 Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


---
* Origin: Waldo's Place USA Internet Gateway (1:3634/1000)
SEEN-BY: 633/267 270
@PATH: 3634/1000 12 106/2000 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.