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

The GIF attached to an issue is broken after the issue has been reported #2719

Open
cipriansv opened this issue Nov 29, 2018 · 10 comments
Open
Assignees

Comments

@cipriansv
Copy link
Collaborator

cipriansv commented Nov 29, 2018

Steps to reproduce:

  1. Navigate to: https://webcompat.com/issues/new
  2. Report an issue with an attached GIF.
  3. Observe the GIF rendering.

Expected Behavior:
The GIF must be displayed with no rendering issues.

Actual Behavior:
The GIF is broken. See issue #21981.

Notes:

  1. The issue is reproducible on Chrome 70.0.3538.110

Watchers:
@softvision-oana-arbuzov
@softvision-sergiulogigan
@cipriansv

sv;

@magsout
Copy link
Member

magsout commented Dec 4, 2018

@cipriansv thanks for the report.

What do you mean by The GIF is broken ? I tried on Chrome and Firefox and I don't see any issue?

@softvision-sergiulogigan
Copy link
Collaborator

@magsout check out the GIF attachment of webcompat/web-bugs#21981

@magsout
Copy link
Member

magsout commented Dec 4, 2018

@softvision-sergiulogigan oh got it.

Same gif, but the first was filled directly withing the webcompat form and the second within a comment on Github, right?

@softvision-sergiulogigan
Copy link
Collaborator

@magsout yup

@karlcow
Copy link
Member

karlcow commented Jan 31, 2019

Probably related to #1024

I need to check if pillow has improved on the animated GIF side of things.

@karlcow
Copy link
Member

karlcow commented Jan 31, 2019

We are currently using Pillow==5.2.0

The current version is 5.4.1

Ah I see that in 4.1.0 something was changed with regards to GIF and Palettes.

The code is here.

def save(self):
'''Check that the file is allowed, then save to filesystem.'''
save_parameters = {}
if self.file_ext not in self.ALLOWED_FORMATS:
raise TypeError('Image file format not allowed')
# Paths of the images
file_dest = app.config['UPLOADS_DEFAULT_DEST'] + self.image_path
thumb_dest = app.config['UPLOADS_DEFAULT_DEST'] + self.thumb_path
dest_dir = os.path.dirname(file_dest)
if not os.path.exists(dest_dir):
os.makedirs(dest_dir)
# Alpha channels are not supported in JPEG
if (self.image_object.format == 'PNG'):
self.image_object = self.image_object.convert('RGB')
# Optimize further the image compression for these formats
if self.image_object.format in ['JPEG', 'JPG', 'JPE', 'PNG']:
save_parameters['optimize'] = True
# Convert PNG to JPEG. See issue #1051
file_dest = 'jpg'.join(file_dest.rsplit('png', 1))
# If animated GIF, aka duration > 0, add save_all parameter
if (self.image_object.format == 'GIF' and
self.image_object.info['duration'] > 0):
save_parameters['save_all'] = True
# unpacking save_parameters
self.image_object.save(file_dest, **save_parameters)
# Creating the thumbnail
size = (1024, 1024)
self.image_object.thumbnail(size, Image.HAMMING)
self.image_object.save(thumb_dest, **save_parameters)

@karlcow
Copy link
Member

karlcow commented Jan 31, 2019

<a
  href="https://webcompat.com/uploads/2018/11/93e4a08e-aa43-4bd5-85b9-f50e3a73cb7b.gif"
  rel="nofollow"
  ><img
    src="https://camo.githubusercontent.com/e14dfdd6cf740863938dd16731ed7df0882ee4ff/68747470733a2f2f776562636f6d7061742e636f6d2f75706c6f6164732f323031382f31312f39336534613038652d616134332d346264352d383562392d6635306533613733636237622d7468756d622e676966"
    alt="Screenshot Description"
    data-canonical-src="https://webcompat.com/uploads/2018/11/93e4a08e-aa43-4bd5-85b9-f50e3a73cb7b-thumb.gif"
    style="max-width:100%;"
/></a>

how come the image is on GitHub… It is supposed to be on webcompat.com.

I need to test with some gifs.

@karlcow
Copy link
Member

karlcow commented Jan 31, 2019

ok I checked most of the animated gif uploaded in 2018. All of them have a broken palette of colors.
There is something to fix there (if we can).

@karlcow
Copy link
Member

karlcow commented Jan 31, 2019

Yeah still not solved on Pillow side. python-pillow/Pillow#2893

@karlcow
Copy link
Member

karlcow commented Jan 31, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants