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

fix: Flaws in en-us/learn/accessibility/ #1587

Merged
merged 1 commit into from
Jan 22, 2021

Conversation

nschonni
Copy link
Contributor

No description provided.

@nschonni nschonni requested review from a team and chrisdavidmills and removed request for a team January 21, 2021 23:07
@nschonni
Copy link
Contributor Author

nschonni commented Jan 21, 2021

@peterbe this is an interesting failure, it looks like it pulled down a JPG, but decided on the check that it should be a PNG.
Probably something to spin out to a separate issue, but should it be fixing the extension if it downloads it and finds it's incorrect? Or is the test possibly bad?

 $ env-cmd --silent cross-env CONTENT_ROOT=files node node_modules/@mdn/yari/filecheck/cli.js --cwd=$(pwd) /home/runner/work/content/content/files/en-us/learn/accessibility/accessibility_troubleshooting/assessment-site-finished.png /home/runner/work/content/content/files/en-us/learn/accessibility/css_and_javascript/focus-highlight-chrome.png /home/runner/work/content/content/files/en-us/learn/accessibility/css_and_javascript/focus-highlight-firefox.png /home/runner/work/content/content/files/en-us/learn/accessibility/css_and_javascript/tabbed-info-box.png /home/runner/work/content/content/files/en-us/learn/accessibility/html/button-focused-unfocused.png /home/runner/work/content/content/files/en-us/learn/accessibility/html/title-attribute.png /home/runner/work/content/content/files/en-us/learn/accessibility/html/voiceover-formcontrols.png /home/runner/work/content/content/files/en-us/learn/accessibility/html/voiceover-good-form-label.png /home/runner/work/content/content/files/en-us/learn/accessibility/multimedia/closed-captions.png /home/runner/work/content/content/files/en-us/learn/accessibility/multimedia/native-controls-chrome.png /home/runner/work/content/content/files/en-us/learn/accessibility/multimedia/native-controls-firefox.png /home/runner/work/content/content/files/en-us/learn/accessibility/multimedia/subtitles_german.jpg /home/runner/work/content/content/files/en-us/learn/accessibility/multimedia/video-player-with-captions.png /home/runner/work/content/content/files/en-us/learn/accessibility/wai-aria_basics/landmarks-list.png
Error: /home/runner/work/content/content/files/en-us/learn/accessibility/multimedia/subtitles_german.jpg is type 'image/png' but named extension is '.jpg'

Copy link
Contributor

@chrisdavidmills chrisdavidmills left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but waiting on a merge for further discussion about the failing test.

@peterbe
Copy link
Contributor

peterbe commented Jan 22, 2021

@peterbe this is an interesting failure, it looks like it pulled down a JPG, but decided on the check that it should be a PNG.
Probably something to spin out to a separate issue, but should it be fixing the extension if it downloads it and finds it's incorrect? Or is the test possibly bad?

 $ env-cmd --silent cross-env CONTENT_ROOT=files node node_modules/@mdn/yari/filecheck/cli.js --cwd=$(pwd) /home/runner/work/content/content/files/en-us/learn/accessibility/accessibility_troubleshooting/assessment-site-finished.png /home/runner/work/content/content/files/en-us/learn/accessibility/css_and_javascript/focus-highlight-chrome.png /home/runner/work/content/content/files/en-us/learn/accessibility/css_and_javascript/focus-highlight-firefox.png /home/runner/work/content/content/files/en-us/learn/accessibility/css_and_javascript/tabbed-info-box.png /home/runner/work/content/content/files/en-us/learn/accessibility/html/button-focused-unfocused.png /home/runner/work/content/content/files/en-us/learn/accessibility/html/title-attribute.png /home/runner/work/content/content/files/en-us/learn/accessibility/html/voiceover-formcontrols.png /home/runner/work/content/content/files/en-us/learn/accessibility/html/voiceover-good-form-label.png /home/runner/work/content/content/files/en-us/learn/accessibility/multimedia/closed-captions.png /home/runner/work/content/content/files/en-us/learn/accessibility/multimedia/native-controls-chrome.png /home/runner/work/content/content/files/en-us/learn/accessibility/multimedia/native-controls-firefox.png /home/runner/work/content/content/files/en-us/learn/accessibility/multimedia/subtitles_german.jpg /home/runner/work/content/content/files/en-us/learn/accessibility/multimedia/video-player-with-captions.png /home/runner/work/content/content/files/en-us/learn/accessibility/wai-aria_basics/landmarks-list.png
Error: /home/runner/work/content/content/files/en-us/learn/accessibility/multimedia/subtitles_german.jpg is type 'image/png' but named extension is '.jpg'

Which page had a .jpg that then became .png?

@nschonni
Copy link
Contributor Author

From

<p><img alt='An English film with German subtitles "Emo, warum erkennst du nicht die Schonheit dieses Ortes?"' src="https://mdn.mozillademos.org/files/14442/Subtitles_German.jpg" style="display: block; margin: 0 auto;"></p>

Interstly, if you look at https://media.prod.mdn.mozit.cloud/attachments/2016/12/03/14442/da114167d08d97a954387f15bfffdf49/Subtitles_German.jpg "View Image Info" it also recognizes it as a PNG

But the downloader pulled it down and kept the "JPG" extension because that's what it declared

@peterbe
Copy link
Contributor

peterbe commented Jan 22, 2021

If it actually is a PNG, it should become Subtitles_German.png. But does it use the right compression plugin is the question.

@nschonni
Copy link
Contributor Author

I just manually renamed the extension and src to PNG and the build is happy again.
I'll leave it to you to decide if there should be an issue to fix the download handling to sniff the type or just leave it to be caught in the filecheck like today

@peterbe
Copy link
Contributor

peterbe commented Jan 22, 2021

Oh I see. It does not become subtitles_german.png unless you manually fixed it. Yeah, it's because the file it writes is based on the URL, not based on the image.
I don't think it's worth writing a bunch of new code for it.

@nschonni
Copy link
Contributor Author

OK, I think this is OK to land then

@chrisdavidmills chrisdavidmills merged commit 2979215 into mdn:main Jan 22, 2021
@nschonni nschonni deleted the flaws-accessibility branch January 22, 2021 19:18
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants