-
Notifications
You must be signed in to change notification settings - Fork 10.6k
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
[bug] pillow will always recode images in imagepipieline #3055
Comments
Well, seems reasonable to me, but you can simply extend the default image pipeline and override the method to do what you want. |
I don't know image pipeline of scrapy will always damage the quality of image, even after have read scrapy's documents. |
Hi @NewUserHa - I'm sorry this has been a problem for you! The documents do say, at the higher-level overview, that the images pipeline will convert all images to a common format, namely JPG with RGBA colourspace. I think similarly to you, that unless the user explicitly requests recoding, the images would be better left alone. But, that's one of the big differences between simply using the Files pipeline and the Images pipeline, I guess. I'd suggest using the Files pipeline for now, if you want the unaltered images to be exactly as they occur online. |
I meant images pipeline will still convert a jpg file to a less quality jpg file. is that a problem? |
I'd need to read the code again to see whether quality is 'expected' to change under normal conditions.. but I do think there's a problem with the docs if this behaviour is surprising. |
it's a problem. jpg encoding is lossy. pillow shouldn't reencode jpg to jpg at least. |
I believe the documentation is OK.
It says I’ve checked the code and @NewUserHa If you believe they are, please share an example image that gets converted and should not. Otherwise, I believe we should close this issue. |
Did you try yourself? DID you really double check it ?
|
If that is so, please provide the smallest image possible that allows to reproduce the issue. It can be used to test a fix. |
Although I could not visually appreciate any difference, I think we could consider modifying |
Looks like the author of the linked PR hasn't responded to the last few suggestions. |
@drs-11 By all means, be our guest. The scenario is covered in our contributing guidelines:
|
scrapy/scrapy/pipelines/images.py
Line 151 in aa83e15
this line will always recode images silently and damage the image quality.
please add an option to avoid this.
The text was updated successfully, but these errors were encountered: