Comments (5)
Hi. It seems that Optimize Images was not able to import Pillow. Are you sure Optimize Images was installed using the same Python version (or virtual environment if it's the case) as Pillow? Please check with the command:
python3.7 -m pip list
Also, please specify it you installed Optimize Images 1.4.0 from PyPI (using pip
) or if you have downloaded and installed the current development snapshot from this Github repo.
from optimize-images.
Hi Victor,
Thank you for the quick reply. I installed it using pip3 install pillow
as in above snapshot. As you requested, I ran pip list with python3.7 -m pip list
which returned:
pi@camerapi:~ $ python3.7 -m pip list
Package Version
-------------------- ---------
Adafruit-DHT 1.4.0
asn1crypto 0.24.0
bcrypt 3.2.0
certifi 2018.8.24
cffi 1.14.5
chardet 3.0.4
click 7.1.2
cryptography 2.6.1
entrypoints 0.3
idna 2.6
keyring 17.1.1
keyrings.alt 3.1.1
optimize-images 1.4.0
paramiko 2.7.2
picamera 1.13
piexif 1.1.3
Pillow 8.1.0
pip 18.1
pycparser 2.20
pycrypto 2.6.1
PyGObject 3.30.4
PyNaCl 1.4.0
pysftp 0.2.9
python-apt 1.8.4.3
pyxdg 0.25
requests 2.21.0
RPi.GPIO 0.7.0
SecretStorage 2.3.1
sensirion-i2c-driver 1.0.0
sensirion-i2c-sht 0.2.1
setuptools 40.8.0
six 1.12.0
speedtest-cli 2.1.2
ssh-import-id 5.7
urllib3 1.24.1
wheel 0.32.3
Looks like indeed version 1.4.0 is installed and Pillow v8.1.0.
Kind regards,
Remco
from optimize-images.
I found an alternate solution to my issue with below function:
from PIL import Image
def compress_image(file=False):
if file:
img = Image.open(file)
img.save(file, optimize=True, quality=60)
This gives me the simple compression I was looking for. Thanks for your time, but not need to chase this.
All the best,
Remco
from optimize-images.
Thanks for you report. I will try to review the error message and the usage of Pillow, thought, since the same issue could be happening to other users.
from optimize-images.
Sorry for getting back to a closed issue. Just a quick notice to let you know that I have found a similar behaviour on my Mac, right after pip installing Optimize Images. It would not find Pillow. However, after exiting the shell and opening it again, it worked as expected.
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
- [Feature Request] Option to skip files raising exceptions. 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
- 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.