GithubHelp home page GithubHelp logo

Comments (5)

victordomingos avatar victordomingos commented on May 29, 2024

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.

RemBrandNL avatar RemBrandNL commented on May 29, 2024

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.

RemBrandNL avatar RemBrandNL commented on May 29, 2024

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.

victordomingos avatar victordomingos commented on May 29, 2024

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.

victordomingos avatar victordomingos commented on May 29, 2024

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)

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.