Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Working with unsigned/signed types

Thread Tools

Working with unsigned/signed types

Posts: n/a
Hi everyone-
I've been away from coding for a while (I turned into a professional
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

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?

-Brian Shirk

Avalanche Photography LLC
McCall, Idaho
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can XSD simple types be derived from complex types? Soren Kuula XML 2 12-01-2005 07:51 PM
Where are ref types that are members of value types stored? Sathyaish ASP .Net 2 05-22-2005 07:32 PM
missing types in module types? Manlio Perillo Python 0 05-29-2004 06:33 AM
Boost + Python C/API: Mixing python return types with boost return types Steve Knight Python 2 10-10-2003 10:11 AM
STD types vs C++ intrinsic types Jeremy Cowles C++ 5 08-19-2003 05:33 PM