learningequality / learningequality/studio

Setting a channel thumbnail as an SVG via ricecooker breaks publishing

Open
#5,114 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
191
Forks
307
Avg merge
5d 6h
Merged PRs (30d)
10

Description

This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.

This seemed to have been caused by using an SVG image as the thumbnail for a channel. It's possible this would impact other thumbnails too. Ideally, setting as an SVG would be fine, and it would just be appropriately converted to a PNG on publish.

Sentry Issue: STUDIO-HV3

UnidentifiedImageError: cannot identify image file <File: /tmp/tmp8glzgicl>
(3 additional frame(s) were not displayed)
...
  File "contentcuration/viewsets/channel.py", line 528, in publish
    channel = publish_channel(
  File "contentcuration/utils/publish.py", line 935, in publish_channel
    set_channel_icon_encoding(channel)
  File "contentcuration/utils/publish.py", line 759, in set_channel_icon_encoding
    channel.icon_encoding = convert_channel_thumbnail(channel)
  File "contentcuration/utils/publish.py", line 779, in convert_channel_thumbnail
    return get_thumbnail_encoding(channel.thumbnail)
  File "contentcuration/utils/files.py", line 112, in get_thumbnail_encoding
    with Image.open(inbuffer) as image:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with contentcuration/utils/files.py at get_thumbnail_encoding, then follow the publish path through contentcuration/utils/publish.py and contentcuration/viewsets/channel.py. Reproduce the channel-thumbnail publish failure with an SVG and verify that SVG thumbnails are converted appropriately before encoding, while checking whether other thumbnails are affected.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.