Working with unsigned/signed types

Discussion in 'Python' started by Guest, Dec 20, 2006.

  1. Guest

    Guest Guest

    Hi everyone-
    I've been away from coding for a while (I turned into a professional
    photographer)...
    So now I've taken up a project involving working with EXIF and XMP metadata in
    image files (mainly JPEG and TIFF), and am having some trouble figuring out how
    to handle some of the data...

    Here's what I'm having to do:
    Inside the files, there are various types of data which can be split apart and
    organized fairly easily, given you have unsigned and signed types... Which is
    where I'm running into problems remembering how everything works.

    The first part of the question is fairly basic - in C, working with signed
    integers, the MSB (is that still the right term?) is used to denote positive and
    negative, and the following bits increase towards positive infinity, correct?
    Such that in C, adding one to 0x7fffffff would cause the number to go around to
    -0x7fffffff (or whatever that is), giving -1 for 0xffffffff?

    Secondly, (and this is my weak point as a programmer) to re-insert the data
    after, what would be the most efficient way to pull everything back apart into
    individual characters for putting it all back into the files? I could probably
    figure out something that would work, but I wouldn't be so sure as to its
    reliability.

    Third, being a photographer now rather than a coder, I'd like to give back the
    modules I'm writing to the community (it looks like very little of the sort
    exists), but would rather not worry about them in the future... Is there a good
    way to go about this?

    Thanks!
    -Brian Shirk

    Avalanche Photography LLC
    www.AvalanchePhoto.com
    McCall, Idaho
    Guest, Dec 20, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jason Heyes
    Replies:
    2
    Views:
    588
    Jason Heyes
    Feb 14, 2005
  2. Ben Finney
    Replies:
    11
    Views:
    491
    Dan Bishop
    Dec 24, 2006
  3. Guest
    Replies:
    1
    Views:
    346
  4. Sriniv

    Unsigned and signed char types

    Sriniv, Jun 12, 2005, in forum: C Programming
    Replies:
    4
    Views:
    288
    William Ahern
    Jun 13, 2005
  5. pozz
    Replies:
    12
    Views:
    733
    Tim Rentsch
    Mar 20, 2011
Loading...

Share This Page