Giter Site home page Giter Site logo

IOError: cannot identify image file about sigal HOT 7 CLOSED

saimn avatar saimn commented on July 17, 2024
IOError: cannot identify image file

from sigal.

Comments (7)

 avatar commented on July 17, 2024

This issue can be closed. The problem was, that some pictures are broken (size was only 16KB).

from sigal.

saimn avatar saimn commented on July 17, 2024

Thanks for the feedback,
Let's keep the issue opened for now, I will see to catch the exception and add an error log.

from sigal.

markodvornik avatar markodvornik commented on July 17, 2024

Maybe this is related. I got a bit different IOError. I suspect that the JPG file in my collection that caused fatal error got corrupted during ftp transfer. However if I run sigal only on that folder it goes trough without an error.

My sugestion would be that sigal keeps on processing the collection despite fatal error on one of the images. With large multimedia collections it's not that convenient to run sigal over and over again until all faulty images are singled out.

DEBUG: Processor: ResizeToFit
Traceback (most recent call last):
  File "/usr/local/bin/sigal", line 9, in <module>
    load_entry_point('sigal==0.6.0', 'console_scripts', 'sigal')()
  File "/usr/local/lib/python2.7/dist-packages/sigal/__init__.py", line 154, in main
    parser.dispatch()
  File "/usr/local/lib/python2.7/dist-packages/argh/helpers.py", line 53, in dispatch
    return dispatch(self, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/argh/dispatching.py", line 124, in dispatch
    for line in lines:
  File "/usr/local/lib/python2.7/dist-packages/argh/dispatching.py", line 200, in _execute_command
    for line in result:
  File "/usr/local/lib/python2.7/dist-packages/argh/dispatching.py", line 183, in _call
    result = args.function(*positional, **keywords)
  File "/usr/local/lib/python2.7/dist-packages/sigal/__init__.py", line 109, in build
    gal.build()
  File "/usr/local/lib/python2.7/dist-packages/sigal/gallery.py", line 226, in build
    self.pool.map_async(worker, media_list).get(9999)
  File "/usr/lib/python2.7/multiprocessing/pool.py", line 528, in get
    raise self._value
IOError: image file is truncated (35 bytes not processed)

from sigal.

tintamarre avatar tintamarre commented on July 17, 2024

I had the same issue yesterday.

After verifying each image, I run Sigal again with less NCPU and it went trough without an error ...

from sigal.

markodvornik avatar markodvornik commented on July 17, 2024

NCPU didn't work for me.

from sigal.

markodvornik avatar markodvornik commented on July 17, 2024

The problem is in

img = PILImage.open(source)

when source is a broken image file (according to PIL). A dirty workaround would be to wrap generate_image & generate_thumbnail functions in image.py in try/except.

This workaround results in gallery being made, but with blank thumbnails and no preview for broken source images.

from sigal.

saimn avatar saimn commented on July 17, 2024

A dirty workaround would be to wrap generate_image & generate_thumbnail functions in image.py in try/except.

Yeah, that's something I must look at. Could you send me examples of broken file ?

from sigal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.