ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> image-sig
image-sig
[Image-SIG] Re: PIL && JPG => cannot identify image file PROBLEM
by Fredrik Lundh other posts by this author
Jul 19 2004 5:08PM messages near this date
[Image-SIG] PIL && JPG => cannot identify image file PROBLEM | Re: [Image-SIG] PIL && JPG => cannot identify image file PROBLEM
Viktor Lacina wrote:

>  That's probably the same situation as PIL, at finaly the problem is, that
>  picture is taken by relatively new pice of digital camera from OLUMPUS which
>  has set on EXIFII file format. PIL looks like supports older(first) version
>  of EXIF (and by source code, only experimentaly).

looks like your camera is adding junk to the JPEG stream; I've attached a patch
that solves this specific problem.

regards /F

Index: PIL/JpegImagePlugin.py
===================================================================
--- PIL/JpegImagePlugin.py      (revision 1923)
+++ PIL/JpegImagePlugin.py      (working copy)
@@ -271,8 +271,8 @@
                     # self.__offset = self.fp.tell()
                     break
                 s = self.fp.read(1)
-            elif i == 65535:
-                # padded marker; move on
+            elif i == 0 or i == 65535:
+                # padded marker or junk; move on
                 s = "\xff"
             else:
                 raise SyntaxError("no marker found")



_______________________________________________
Image-SIG maillist  -  Image-SIG@[...].org
http://mail.python.org/mailman/listinfo/image-sig
Thread:
Viktor Lacina
Fredrik Lundh
Jim Tittsler
Viktor Lacina

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved