Registry / devops / libthumbor

libthumbor

JSON →
library2.0.2pypypi✓ verified 84d ago

A Python library for generating thumbor image processing URLs. Version 2.0.2. Provides cryptographic URL signing and parameter building for secure image transformations. Compatible with Python 3.6+.

pip install libthumbor
INSTALL
IMPORT
SIG · LIBTHUMBOR
L
libthumbor
devopspythonv2.0.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

CryptoURL
from libthumbor import CryptoURL

Create a CryptoURL instance with your thumbor security key and generate signed URLs for secure image transformation.

from libthumbor import CryptoURL # Initialize with your thumbor security key crypto = CryptoURL(key='my-security-key') # Generate a signed URL image_url = '/some/image.jpg' signed_url = crypto.generate(image_url=image_url) print(signed_url)
Debug
Known issues
deprecatedThe 'image_url' parameter is deprecated in favor of 'image_path' in recent versions. Check your thumbor version compatibility.
fix
Use crypto.generate(image_path='/some/image.jpg') instead of image_url.
affects: >=2.0.0
gotchaCryptoURL's 'key' parameter expects a string. Passing a bytes object will cause a TypeError.
fix
Ensure key is a str, not bytes: CryptoURL(key='my-key').
affects: all
gotchaThe library uses SHA256 HMAC by default for signing. If your thumbor server uses a different algorithm, signature mismatch may occur.
fix
Use the 'hash_algorithm' parameter: CryptoURL(key='...', hash_algorithm='sha1').
affects: all
Errors
Common errors & fixes
AttributeError: module 'libthumbor' has no attribute 'CryptoURL'
Incorrect import or outdated version that might not have CryptoURL.
fix
Update to the latest version: pip install --upgrade libthumbor. Then use: from libthumbor import CryptoURL.
CryptoURL() takes 1 positional argument but 2 were given
Passing the key as a positional argument besides the first parameter. CryptoURL(key='...') expects keyword argument.
fix
Use keyword argument: CryptoURL(key='your-key').
TypeError: key must be a string, not bytes
Passing bytes instead of str for the key parameter.
fix
Convert bytes to str: CryptoURL(key=b'key'.decode()).
Upgrade
Version history
2.0.2latest on PyPI · released Mar 31, 2022
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources

No resource links recorded.

libthumbor — pip install libthumbor · libregistry