From 09e934d7c2e0f27e729899f9e06c3674a89f4703 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Benoi=CC=82t=20Pin?= Date: Thu, 14 Nov 2013 21:05:53 +0100 Subject: [PATCH 1/1] =?utf8?q?Le=20=20=C2=AB=C2=A0XMP=20packet=20wrapper?= =?utf8?q?=C2=A0=C2=BB=20est=20optionnel.=20On=20=C3=B4te=20l=E2=80=99asse?= =?utf8?q?rtion=20qui=20la=20voulait=20co=C3=BBte=20que=20co=C3=BBte.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- xmp.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/xmp.py b/xmp.py index 2270eeb..8738e50 100755 --- a/xmp.py +++ b/xmp.py @@ -72,9 +72,12 @@ class XMP(object) : # tests / unwrap reEncodedHeader = re.compile(self.XMP_HEADER_PATTERN.encode(self.encoding)) m = reEncodedHeader.match(packet) - assert m is not None, "No xmp header found" - xmp = packet[m.end():] + if m is None : + console.warn('XMP packet wrapper not found') + self.xmp = packet + return + xmp = packet[m.end():] trailer = self.XMP_TRAILER[:-6].encode(self.encoding) # TODO handle read-only mode trailerPos = xmp.find(trailer) assert trailerPos != -1, "No xmp trailer found" -- 2.20.1