NUKnightLab / NUKnightLab/TimelineJS3
Add "imageblank" to allowable media types for thumbnails
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 3.2k
- Forks
- 645
- PR merge metrics
- No merged PRs in 30d
Description
In a ZenDesk question, someone reported a case of their customized thumbnails not appearing in their timeline, even though the same image URL was used for the main media on the slide, where they did appear.
The URLs went to something which might be a content management system; more to the point, they end with URL parameters, not a typical file extension. This means that they are handled using the "fallback" assumption that any URL which isn't something else should be treated as an image.
However, for thumbnails, this fallback is not considered, so the same URL did not have parallel results.
It seems like a low-risk fix to simply add the fallback into the image_only path through lookupMediaType. Architecturally, this might be a time to move the image_only smarts from hard-coded in the function into the url pattern data structure, since the "awareness" of whether a given Media subclass is suitable for getting a URL which can go into an img tag belongs with the subclass.
Structurally, it might be more elegant to move the URL testing responsibility into each Media subclass ("can you handle this URL?") but that would increase the effort to review and understand the entire system. So that's probably overengineering.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/js/media/MediaType.js, reading the fallback handling in lookupMediaType and the image_only branches referenced in the issue. Confirm how a URL with query parameters is classified for main media versus thumbnails; done when both paths accept the same fallback image URL behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 65/100