google-code-export / thebigpicture

Automatically exported from code.google.com/p/thebigpicture
1 stars 1 forks source link

decoding one char ascii fields #38

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. When reading a GPSLatitudeRef, None is returned 

What is the expected output? What do you see instead?
'E' or 'W' of cause (and they are really in the GPS exif block)

What version of the product are you using? On what operating system?
I've tested with v1-alpha2, but r66 from SVN uses the same code.

Please provide any additional information below.

In ifd.Ascii.decode a string is only appended to the result set, if it
is 0-terminated. That's not the case for GPSLatitudeRef/GPSLongitudeRef.

The appended patch adds the last string to the result set, even if it's
not 0-terminated.

Cheers,

Martin

--- ifd.py~     2008-03-25 16:48:33.000000000 +0100
+++ ifd.py      2008-03-25 16:48:33.000000000 +0100
@@ -61,6 +61,8 @@
         curr_stream = ""
       else:
         curr_stream += char
+    if len(curr_stream) > 0:
+      streams.append(curr_stream)

     return streams

Original issue reported on code.google.com by Depperte...@googlemail.com on 25 Mar 2008 at 4:14