Question re jpg file format, trying to add jpg comments

Discussion in 'Digital Photography' started by Chris, Oct 21, 2004.

  1. Chris

    Chris Guest

    I'm trying to write a simple (hopefully) Python script to add comments
    to a jpg file. I was initially going to add to the Exif "Image
    Description" tag, but then discovered the jpg "COM marker" and this
    seems to be an easier task, I think. But I have some questions on the
    restrictions/rules for COM markers in jpg files.

    Are there any restrictions on where the COM section is located in the
    file (beyond not putting it at the beginning or in the middle of
    another marker section)? Specifically, I was just going to put the
    COM section at the end of the file as this seems easy. I did this for
    a test jpg, and the jpg is still readable by various image programs,
    but I'm not sure if the comment is written correctly. The program
    "Exifer", which can read and write COM markers, does not see my
    comment. When it adds a COM section, it puts it somewhere in the
    middle of the file.

    So really the question is what restrictions are there on the location
    of the jpg COM marker? Can I stick it at the end?

    Thanks for any info. I've searched for file layout specs but can't
    find anything very specific related to the COM marker location.

    Chris, Oct 21, 2004
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.