Skip to content

Latest commit

 

History

History
29 lines (25 loc) · 873 Bytes

README.md

File metadata and controls

29 lines (25 loc) · 873 Bytes

thumbnail-manager

A package to generate and manage thumbnails for images.

Features:

  • Generates thumbnail for an image url
  • Supports thumbnail size customization
  • Supports caching of thumbnails

Installation:

git clone https://github.com/shadowfaxproject/thumbnail-manager.git
cd thumbnail-manager
pip install -r requirements.txt

# Add thumbnail-manager to your PYTHONPATH to make it accessible
export PYTHONPATH=$PYTHONPATH:/path/to/thumbnail-manager

Usage:

import os
from thumbnail-manager import ThumbnailManager

image_url = 'https://picsum.photos/600/200'
cache_dir = '/path/to/cache_dir'
tm = ThumbnailManager(cache_dir=cache_dir, thumbnail_size=(100, 100))
thumbnail_file = tm.generate_thumbnail(image_url=image_url)
thumbnail_file_path = os.path.join(cache_dir, thumbnail_file)
print(os.path.exists(thumbnail_file_path))