Comments (2)
Seems to be an issue similar to #13. There were some commits on this repository since the latest PyPI update. It may have been solved recently. The expected behaviour is to skip the problematic files and keep going with the next, silently. No logging implemented for now, though.
Are you able to test it with the current GitHub version?
from optimize-images.
Current version sometimes fails for me:
concurrent.futures.process._RemoteTraceback:
"""
Traceback (most recent call last):
File "C:\Program Files\Python39\lib\concurrent\futures\process.py", line 243, in _process_worker
r = call_item.fn(*call_item.args, **call_item.kwargs)
File "C:\Program Files\Python39\lib\concurrent\futures\process.py", line 202, in _process_chunk
return [fn(*args) for args in chunk]
File "C:\Program Files\Python39\lib\concurrent\futures\process.py", line 202, in <listcomp>
return [fn(*args) for args in chunk]
File "C:\src\optimize-images\optimize_images\do_optimization.py", line 44, in do_optimization
return optimize_jpg(t)
File "C:\src\optimize-images\optimize_images\img_optimize_jpg.py", line 119, in optimize_jpg
has_exif)
UnboundLocalError: local variable 'has_exif' referenced before assignment
"""
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Program Files\Python39\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Program Files\Python39\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\src\optimize-images\optimize_images\__main__.py", line 139, in <module>
main()
File "C:\src\optimize-images\optimize_images\__main__.py", line 96, in main
for r in executor.map(do_optimization, tasks):
File "C:\Program Files\Python39\lib\concurrent\futures\process.py", line 559, in _chain_from_iterable_of_lists
for element in iterable:
File "C:\Program Files\Python39\lib\concurrent\futures\_base.py", line 600, in result_iterator
yield fs.pop().result()
File "C:\Program Files\Python39\lib\concurrent\futures\_base.py", line 433, in result
return self.__get_result()
File "C:\Program Files\Python39\lib\concurrent\futures\_base.py", line 389, in __get_result
raise self._exception
UnboundLocalError: local variable 'has_exif' referenced before assignment
Process finished with exit code 1
from optimize-images.
Related Issues (20)
- skip optimization on error, don't exit process HOT 1
- log what file is raising error HOT 6
- Use imghdr.what() to detect image type from file signature in do_optimization()
- Skip non-image file types HOT 4
- AttributeError: 'NoneType' object has no attribute 'orig_size' HOT 3
- Command line icons not properly shown in Windows HOT 5
- PIL.UnidentifiedImageError: cannot identify image file HOT 6
- Keep Image resolution (DPI) HOT 3
- Allow export to format ".webp" HOT 2
- Read-only file system /~temp~image.png HOT 7
- Convert png to jpg regardless of size HOT 2
- [Feature Request] Docker support HOT 10
- Brunsli support? HOT 1
- Claims Pillow isn't installed while it is? HOT 5
- Skips png's HOT 2
- Ability to Suppress Output HOT 2
- UnboundLocalError: local variable 'has_exif' referenced before assignment HOT 4
- Error with Pillow 8.2.0 and python 3.10 HOT 3
- Destroys EXIF data despite --keep-exif HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from optimize-images.