algoo / preview-generator

generates previews of files with cache management
https://pypi.org/project/preview-generator/
MIT License
224 stars 49 forks source link

Bug: Weird result on png file. #261

Closed inkhey closed 2 years ago

inkhey commented 3 years ago

Description and expectations

Some png file return wrong background color for preview as jpeg + the quality obtain is poor.

How to reproduce

Version information

Diagnostic

The problem is that:

Note: the background color used by imagemagick for jpeg to png convertion differ between file. for this other file, the background is ok, so the bug does not concern all png files:

inkhey commented 3 years ago

I create a fix for this: https://github.com/algoo/preview-generator/pull/262 . This fix:

During test, i also discover that as we do use intermediate png, it may create huge png file from compressed format like jpeg (for exemple a 7Mo jpeg can create a 40mo png).

I do suggest to solve this by removing the intermediate format for img builder. This also mean we should take care of having similar quality result between pillow and img builder, similar background color, etc...

tonypottera24 commented 2 years ago

I agree with @inkhey, reducing memory is important especially when running preview-generator in memory limited dockers.

inkhey commented 2 years ago

This issue as been solved with the wand backend