Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to run Thumbor on Windows 11 #1667

Open
dthornton10 opened this issue May 14, 2024 · 1 comment
Open

Unable to run Thumbor on Windows 11 #1667

dthornton10 opened this issue May 14, 2024 · 1 comment
Labels

Comments

@dthornton10
Copy link

Thumbor request URL

The request url for the issue you are having, you can swap the host name with a fake

Expected behaviour

When I type Thumbor in CLI, I would expect that an application be run

Actual behaviour

I receive the following error:

C:\Windows\System32>thumbor
Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in run_code
File "C:\Python312\Scripts\thumbor.exe_main
.py", line 4, in
File "C:\Python312\Lib\site-packages\thumbor\server.py", line 23, in
from tornado.netutil import bind_unix_socket
ImportError: cannot import name 'bind_unix_socket' from 'tornado.netutil' (C:\Python312\Lib\site-packages\tornado\netutil.py)

Additionally, I ran thumbor-doctor and these were the results:

C:\Windows\System32>thumbor-doctor

Thumbor v7.7.4 (of 04-Mar-2024)

Thumbor doctor will analyze your install and verify if everything is working as expected.

Verifying libraries support...

✅ pycurl is installed correctly.
✅ cairosvg is installed correctly.

Verifying thumbor compiled extensions...

❎ _alpha
❎ _bounding_box
❎ _brightness
❎ _colorize
❎ _composite
❎ _contrast
❎ _convolution
❎ _curve
❎ _equalize
❎ _fill
❎ _nine_patch
❎ _noise
❎ _rgb
❎ _round_corner
❎ _saturation
❎ _sharpen

Verifying extension programs...

❎ jpegtran is not installed.
Thumbor uses jpegtran for optimizing JPEG images. For more information visit https://linux.die.net/man/1/jpegtran.

❎ ffmpeg is not installed.
Thumbor uses ffmpeg for rendering animated images as GIFV. For more information visit https://www.ffmpeg.org/.

❎ gifsicle is not installed.
Thumbor uses gifsicle for better processing of GIF images. For more information visit https://www.lcdf.org/gifsicle/.

Verifying security...

😞 Oh no! We found some things that could improve... 😞

⛔Errors⛔

  • Extension thumbor.ext.filters._alpha
    Error Message:
    No module named 'thumbor.ext.filters._alpha'

    Error Description:
    Extension could not be compiled. This will lead to filter being disabled.

  • Extension thumbor.ext.filters._bounding_box
    Error Message:
    No module named 'thumbor.ext.filters._bounding_box'

    Error Description:
    Extension could not be compiled. This will lead to filter being disabled.

  • Extension thumbor.ext.filters._brightness
    Error Message:
    No module named 'thumbor.ext.filters._brightness'

    Error Description:
    Extension could not be compiled. This will lead to filter being disabled.

  • Extension thumbor.ext.filters._colorize
    Error Message:
    No module named 'thumbor.ext.filters._colorize'

    Error Description:
    Extension could not be compiled. This will lead to filter being disabled.

  • Extension thumbor.ext.filters._composite
    Error Message:
    No module named 'thumbor.ext.filters._composite'

    Error Description:
    Extension could not be compiled. This will lead to filter being disabled.

  • Extension thumbor.ext.filters._contrast
    Error Message:
    No module named 'thumbor.ext.filters._contrast'

    Error Description:
    Extension could not be compiled. This will lead to filter being disabled.

  • Extension thumbor.ext.filters._convolution
    Error Message:
    No module named 'thumbor.ext.filters._convolution'

    Error Description:
    Extension could not be compiled. This will lead to filter being disabled.

  • Extension thumbor.ext.filters._curve
    Error Message:
    No module named 'thumbor.ext.filters._curve'

    Error Description:
    Extension could not be compiled. This will lead to filter being disabled.

  • Extension thumbor.ext.filters._equalize
    Error Message:
    No module named 'thumbor.ext.filters._equalize'

    Error Description:
    Extension could not be compiled. This will lead to filter being disabled.

  • Extension thumbor.ext.filters._fill
    Error Message:
    No module named 'thumbor.ext.filters._fill'

    Error Description:
    Extension could not be compiled. This will lead to filter being disabled.

  • Extension thumbor.ext.filters._nine_patch
    Error Message:
    No module named 'thumbor.ext.filters._nine_patch'

    Error Description:
    Extension could not be compiled. This will lead to filter being disabled.

  • Extension thumbor.ext.filters._noise
    Error Message:
    No module named 'thumbor.ext.filters._noise'

    Error Description:
    Extension could not be compiled. This will lead to filter being disabled.

  • Extension thumbor.ext.filters._rgb
    Error Message:
    No module named 'thumbor.ext.filters._rgb'

    Error Description:
    Extension could not be compiled. This will lead to filter being disabled.

  • Extension thumbor.ext.filters._round_corner
    Error Message:
    No module named 'thumbor.ext.filters._round_corner'

    Error Description:
    Extension could not be compiled. This will lead to filter being disabled.

  • Extension thumbor.ext.filters._saturation
    Error Message:
    No module named 'thumbor.ext.filters._saturation'

    Error Description:
    Extension could not be compiled. This will lead to filter being disabled.

  • Extension thumbor.ext.filters._sharpen
    Error Message:
    No module named 'thumbor.ext.filters._sharpen'

    Error Description:
    Extension could not be compiled. This will lead to filter being disabled.

  • jpegtran
    Error Message:
    Could not find jpegtran.

    Error Description:
    Thumbor uses jpegtran for optimizing JPEG images. For more information visit https://linux.die.net/man/1/jpegtran.

  • ffmpeg
    Error Message:
    Could not find ffmpeg.

    Error Description:
    Thumbor uses ffmpeg for rendering animated images as GIFV. For more information visit https://www.ffmpeg.org/.

  • gifsicle
    Error Message:
    Could not find gifsicle.

    Error Description:
    Thumbor uses gifsicle for better processing of GIF images. For more information visit https://www.lcdf.org/gifsicle/.

Operating system

Windows 11

Your thumbor.conf

-- coding: utf-8 --

thumbor imaging service

https://github.com/thumbor/thumbor/wiki

Licensed under the MIT license:

http://www.opensource.org/licenses/mit-license

Copyright (c) 2011 globo.com thumbor@googlegroups.com

from os.path import expanduser, join

home = expanduser("~")

the domains that can have their images resized

use an empty list for allow all sources

ALLOWED_SOURCES = ["mydomain.com"]

the max width of the resized image

use 0 for no max width

if the original image is larger than MAX_WIDTH x MAX_HEIGHT,

it is proportionally resized to MAX_WIDTH x MAX_HEIGHT

MAX_WIDTH = 800

the max height of the resized image

use 0 for no max height

if the original image is larger than MAX_WIDTH x MAX_HEIGHT,

it is proportionally resized to MAX_WIDTH x MAX_HEIGHT

MAX_HEIGHT = 600

the quality of the generated image

this option can vary widely between

imaging engines and works only on jpeg images

QUALITY = 85

WEBP_QUALITY = 80

Automatically converts images to WebP if Accepts header present

AUTO_WEBP = False

Automatically converts images to JPG if Accepts header present

AUTO_JPG = False

Automatically converts images to PNG if Accepts header present

AUTO_PNG = False

Automatically converts images to Avif if Accepts header present and

pillow-avif-plugin is enabled

AUTO_AVIF = False

Automatically converts images to Heif if Accepts header present and

pillow-heif is enabled

AUTO_HEIF = False

Automatically converts PNG to JPG if PNG has no transparency.

WARNING: Depending on case, this is not a good deal. This

transformation maybe causes distortions or the size of image can increase.

Images with texts, for example, the result image maybe will be distorted.

Dark images, for example, the size of result image maybe will be bigger.

You have to evaluate the majority of your use cases to take a decision about

this conf.

AUTO_PNG_TO_JPG = False

Specify the ratio between 1in and 1px for SVG images. This is only used when

rasterizing SVG images having their size units in cm or inches.

SVG_DPI = 150

Preserves exif information in generated images. Increases image size in

kbytes, use with caution.

PRESERVE_EXIF_INFO = False

enable this options to specify client-side cache in seconds

MAX_AGE = 24 * 60 * 60

client-side caching time for temporary images (using queued detectors or

after detection errors)

MAX_AGE_TEMP_IMAGE = 0

Sends If-Modified-Since & Last-Modified headers; requires support from result

storage

SEND_IF_MODIFIED_LAST_MODIFIED_HEADERS = False

Sends the Access-Control-Allow-Origin header

ACCESS_CONTROL_ALLOW_ORIGIN_HEADER = "*"

the way images are to be loaded

LOADER = "thumbor.loaders.http_loader"

LOADER = "thumbor.loaders.file_loader"

LOADER = "thumbor.compatibility.loader"

the path to find images

FILE_LOADER_ROOT_PATH = "./tests/fixtures/images"

maximum size of the source image in Kbytes.

use 0 for no limit.

this is a very important measure to disencourage very

large source images.

THIS ONLY WORKS WITH http_loader.

MAX_SOURCE_SIZE = 0

if you set UPLOAD_ENABLED to True,

a route /upload will be enabled for your thumbor process

You can then do a put to this URL to store the photo

using the specified Storage

UPLOAD_ENABLED = False
UPLOAD_PHOTO_STORAGE = "thumbor.storages.file_storage"
UPLOAD_PUT_ALLOWED = False
UPLOAD_DELETE_ALLOWED = False
UPLOAD_DEFAULT_FILENAME = "image"

how to store the loaded images so we don't have to load

them again with the loader

STORAGE = "thumbor.storages.redis_storage"

STORAGE = "thumbor.storages.no_storage"

STORAGE = "thumbor.storages.file_storage"

STORAGE = "thumbor.storages.mixed_storage"

STORAGE = "thumbor.compatibility.storage"

root path of the file storage

FILE_STORAGE_ROOT_PATH = join(home, "thumbor", "storage")

If you want to cache results, use this options to specify how to cache it

Set Expiration seconds to ZERO if you want them not to expire.

RESULT_STORAGE = "thumbor.result_storages.file_storage"

RESULT_STORAGE = "thumbor.compatibility.result_storage"

RESULT_STORAGE_EXPIRATION_SECONDS = 60 * 60 * 24 # one day
RESULT_STORAGE_FILE_STORAGE_ROOT_PATH = join(home, "thumbor", "result_storage")

RESULT_STORAGE_STORES_UNSAFE = False

stores the crypto key in each image in the storage

this is VERY useful to allow changing the security key

STORES_CRYPTO_KEY_FOR_EACH_IMAGE = True

imaging engine to use to process images

ENGINE = "thumbor.engines.pil"

if you need to use the OpenCV engine please refer

to https://github.com/thumbor/opencv-engine

ENGINE = "opencv_engine"

if you need to use the GraphicsMagick engine please refer

to https://github.com/thumbor/graphicsmagick-engine

ENGINE = "graphicsmagick_engine"

The graphics engine (and any optimizers) will block the IOLoop. If you want

to increase the number of concurrent requests Thumbor can handle, increase

ENGINE_THREADPOOLSIZE to use a thread pool. Benchmarks indicate 1xnumber of

cpus - 2x number of cpus gives the best results, but do some benchmarks with

your workload.

ENGINE_THREADPOOL_SIZE = 0

detectors to use to find Focal Points in the image

more about detectors can be found in thumbor's docs

at https://github.com/thumbor/thumbor/wiki

DETECTORS = [
#"thumbor.detectors.face_detector",
#"thumbor.detectors.profile_detector",
#"thumbor.detectors.glasses_detector",
#"thumbor.detectors.feature_detector",
]

Redis parameters for queued detectors

REDIS_QUEUE_MODE = "single_node"

REDIS_QUEUE_SERVER_HOST = "localhost"

REDIS_QUEUE_SERVER_PORT = 6379

REDIS_QUEUE_SERVER_DB = 0

REDIS_QUEUE_SERVER_PASSWORD = None

Redis Sentinel parameters for queued detectors

REDIS_QUEUE_MODE = "sentinel"

REDIS_QUEUE_SENTINEL_INSTANCES = "localhost:26379"

REDIS_QUEUE_SENTINEL_PASSWORD = None

REDIS_QUEUE_SENTINEL_MASTER_INSTANCE = "master"

REDIS_QUEUE_SENTINEL_MASTER_PASSWORD = None

REDIS_QUEUE_SENTINEL_MASTER_DB = 0

REDIS_QUEUE_SENTINEL_SOCKET_TIMEOUT = 10.0

AWS SQS parameters for queued detectors

SQS_QUEUE_KEY_ID = ""

SQS_QUEUE_KEY_SECRET = ""

SQS_QUEUE_REGION = "us-east-1"

if you use face detection this is the file that

OpenCV will use to find faces. The default should be

fine, so change this at your own peril.

if you set a relative path it will be relative to

the thumbor/detectors/face_detector folder

FACE_DETECTOR_CASCADE_FILE = "haarcascade_frontalface_alt.xml"

this is the security key used to encrypt/decrypt urls.

make sure this is unique and not well-known

This can be any string of up to 16 characters

SECURITY_KEY = "MY_SECURE_KEY"

if you enable this, the unencryted URL will be available

to users.

IT IS VERY ADVISED TO SET THIS TO False TO STOP OVERLOADING

OF THE SERVER FROM MALICIOUS USERS

ALLOW_UNSAFE_URL = True

Mixed storage classes. Change them to the fullname of the

storage you desire for each operation.

MIXED_STORAGE_FILE_STORAGE = "thumbor.storages.file_storage"

MIXED_STORAGE_CRYPTO_STORAGE = "thumbor.storages.no_storage"

MIXED_STORAGE_DETECTOR_STORAGE = "thumbor.storages.no_storage"

This configuration indicates whether thumbor should use a

custom error handler.

Defaults to: False

USE_CUSTOM_ERROR_HANDLING = False

ERROR_HANDLER_MODULE = "thumbor.error_handlers.sentry"

SENTRY_DSN_URL = ""

SENTRY_ENVIRONMENT = None

from thumbor.filters import BUILTIN_FILTERS

FILTERS = BUILTIN_FILTERS

can only be applied if there are already points for the image being served

this means that either you are using the local face detector or the image

has already went through remote detection

FILTERS = BUILTIN_FILTERS + [

"thumbor.filters.redeye",

]

OPTIMIZERS = [

"thumbor.optimizers.jpegtran",

"thumbor_plugins.optimizers.gifv",

]

from thumbor.handler_lists import BUILTIN_HANDLERS

HANDLER_LISTS = BUILTIN_HANDLERS + [

# Add your handler list modules here

]

JPEGTRAN_PATH = "/usr/local/bin/jpegtran"

If the CurlAsyncHTTPClient should be used

Defaults to: False

HTTP_LOADER_CURL_ASYNC_HTTP_CLIENT = False

If the CurlAsyncHTTPClient is being used and

should timeout on slow download speed.

SPEED in bytes/s and TIME in s

Dfaults to: 0 (no timeout)

HTTP_LOADER_CURL_LOW_SPEED_TIME = 0

HTTP_LOADER_CURL_LOW_SPEED_LIMIT = 0

################################# Compatibility ################################

Loader that will be used with the compatibility layer, instead of the

compatibility loader. Please only use this if you can't use up-to-date

loaders.

Defaults to: None

COMPATIBILITY_LEGACY_LOADER = None

Storage that will be used with the compatibility layer, instead of the

compatibility storage. Please only use this if you can't use up-to-date

storages.

Defaults to: None

COMPATIBILITY_LEGACY_STORAGE = None

Result Storage that will be used with the compatibility layer, instead of

the compatibility result storage. Please only use this if you can't use

up-to-date result storages.

Defaults to: None

COMPATIBILITY_LEGACY_RESULT_STORAGE = None

################################################################################

Copy link

This issue is stale because it has been open 30 days with no activity. Remove the stale label or add a comment, or this issue will be closed in 15 days. You can always re-open if you still feel this is still an issue. Tag @heynemann for more information.

@github-actions github-actions bot added the Stale label Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant