glib.GError: Error interpreting JPEG image file (Unsupported marker type 0x05)
<p>I am using <a href="http://www.pygtk.org/pygtk2reference/class-gdkpixbufloader.html">gtk.gdk.PixbufLoader</a> since several years.</p>

<p>Today, I try to load a jpg file from a new android device and get this exception:</p>

<pre><code>Traceback (most recent call last):
  File "myscript.py", line 118, in next
    loader.write(buf)
glib.GError: Error interpreting JPEG image file (Unsupported marker type 0x05)
</code></pre>

<p>The same file can be loaded in eog (eye of gnome) and I can use <code>convert</code> (from image-magick) with out error.</p>

<p>It happens for all files, not just one, this leads me to the conclusion that the files are not broken.</p>

<p>What could be wrong?</p>

<p>Here is one of the files: <a href="http://thomas-guettler.de/20160627_163057-0.jpg">http://thomas-guettler.de/20160627_163057-0.jpg</a></p>

<p>Here is a snippet to reproduce the exception:</p>

<pre><code>from gtk.gdk import PixbufLoader
pixbufloader=PixbufLoader()
chunksize=130000
fd=open('20160627_163057-0.jpg', 'rb')
while True:
    bytes=fd.read(chunksize)
    if not bytes:
        break
    print pixbufloader.write(bytes)
pixbufloader.close()
</code></pre>

<p>If you set <code>chunksize</code> to <code>1</code>, then it works.</p>

<p>If I use <code>130000</code> as chunksize, then the first call to <code>write()</code> fails.</p>

<p>I worked on your code and got to the conclusion that exactly after chunksize = 69632,i.e. at chunksize = 69633,This error is shown.
One more this I noticed is that this error is file related if I use any file other than this "20160627_163057-0.jpg" image,error does not occur.</p>

<p>So my conclusion is that this particular file has some problem.
Please check,
Thanks.</p>

python jpeg pygtk glib