-
Notifications
You must be signed in to change notification settings - Fork 89
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
PlaceHolderImage Image size 0 #13
Comments
Thanks for filing this ticket, @jonashagstedt! I'm investigating now and will drop you a message here when I've got it sorted. |
Includes: * Updating tests * Swapping out placeholder.gif for placeholder.png (since PIL doesn’t know how to invert ‘P’ images: https://github.com/python-pillow/Pillow/blob/master/PIL/ImageOps.py#L50)
Hey @jonashagstedt ! This issue has been patched and the fix is available in the 1.0.1 release. Upgrade via pip and you should be good to go:
Thanks again for filing this ticket! |
Smashing. I might give this a go again though now that you've fixed it. Cheers |
Hey @jonashagstedt! Thanks for the kind words about the app! The idea for Once I realized that an on-disc image could be copied onto a field's storage class during startup (and thereby served as MEDIA) it was clear this was the 'best of both worlds' solution I had been searching for. Don't hesitate to file another issue if you run into any more bugs! |
OnDiscPlaceholderImage
seem to have a bug in it:This line:
self.image_data = ContentFile(file.read(), name=name)
causes the file to be read.The next line
super(OnDiscPlaceholderImage, self).__init__(file, name)
is settingself.image_data
again usingfile.read()
, however file.read() will now return''
thusself.image_data
is always''
I found this when I was writing a custom placeholder image class that reads from
STATIC
rather thanMEDIA
The text was updated successfully, but these errors were encountered: