{"id":45939,"library":"python-resize-image","title":"python-resize-image","description":"A small Python package to easily resize images. Supports multiple resizing strategies (crop, pad, thumbnail, etc.). Current version 1.1.20 runs on Python 3.6+.","status":"active","version":"1.1.20","language":"python","source_language":"en","source_url":"https://github.com/VingtCinq/python-resize-image","tags":["image","resize","thumbnail","Pillow"],"install":[{"cmd":"pip install python-resize-image","lang":"bash","label":"Standard install"}],"dependencies":[{"reason":"Required for image processing","package":"Pillow","optional":false}],"imports":[{"note":"resizeimage is a module, not a package. Use 'from resizeimage import resizeimage' to access the class.","wrong":"import resizeimage","symbol":"resizeimage","correct":"from resizeimage import resizeimage"}],"quickstart":{"code":"from PIL import Image\nfrom resizeimage import resizeimage\n\nwith open('test.jpeg', 'r+b') as f:\n    with Image.open(f) as image:\n        cover = resizeimage.resize_cover(image, [200, 100])\n        cover.save('test-cover.jpeg', image.format)","lang":"python","description":"Resize an image using the 'cover' method (crop to fill dimensions)."},"warnings":[{"fix":"Ensure correct import and module name casing.","message":"The resizeimage module is case-sensitive. Import as `from resizeimage import resizeimage` (lowercase).","severity":"gotcha","affected_versions":"all"},{"fix":"Use `with open('image.jpg', 'r+b') as f: Image.open(f)` inside the block.","message":"The library expects file-like objects, not file paths. Always open files with open() before passing.","severity":"gotcha","affected_versions":"all"},{"fix":"Open JPEG files with 'r+b' mode and ensure image is converted to RGB before saving.","message":"JPEG images must be opened with mode 'r+b' (read-write binary) to avoid 'cannot write mode RGBA as JPEG' error when saving.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'1.1.20':23 '3.6':27 'crop':17 'current':21 'easili':10 'etc':20 'imag':4,12,28 'multipl':14 'packag':8 'pad':18 'pillow':31 'python':2,7,26 'python-resize-imag':1 'resiz':3,11,15,29 'run':24 'small':6 'strategi':16 'support':13 'thumbnail':19,30 'version':22","created_at":"2026-06-07T12:57:28.393578+00:00","updated_at":"2026-06-07T12:57:28.393578+00:00","problems":[{"fix":"Use `from resizeimage import resizeimage`.","cause":"Incorrect import: `import resizeimage` instead of `from resizeimage import resizeimage`.","error":"ModuleNotFoundError: No module named 'resizeimage'"},{"fix":"Convert image to RGB: `image = image.convert('RGB')` before saving.","cause":"JPEG does not support alpha channel. The image has an alpha channel, but the output format is JPEG.","error":"OSError: cannot write mode RGBA as JPEG"},{"fix":"First call `resizeimage.resize_cover(image, size)` or import the function: `from resizeimage.resizeimage import resize_cover`.","cause":"Trying to call resize_cover directly on the module instead of a class instance.","error":"AttributeError: module 'resizeimage' has no attribute 'resize_cover'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/VingtCinq/python-resize-image","github":"https://github.com/VingtCinq/python-resize-image","docs":null,"changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}