0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00
ghost/test/unit/frontend/helpers
Simon Backx a051ab3b69
🎨 Reduced favicon requirements and added image formatting (#14918)
fixes https://github.com/TryGhost/Team/issues/1652
fixes https://github.com/TryGhost/Ghost/issues/13319

**Image formatting**
Added support for changing the format of images via the `handle-image-sizes` middleware (e.g. format SVG to png, jpeg, webp)

This change was required:
- Not all browsers support SVG favicons, so we need to convert them to PNGs
- We can't fit image resizing and formatting in the `serve-favicon` middleware: we need to store the resized image to avoid resizing on every request. This system was already present in the `handle-image-sizes` middleware.

To format an uploaded image:
- Original URL: https://localhost/blog/content/images/2022/05/giphy.gif
- To resize: https://localhost/blog/content/images/size/w256h256/2022/05/giphy.gif (already supported)
- To resize and format to webp: https://localhost/blog/content/images/size/w256h256/format/webp/2022/05/giphy.gif
- Animations are preserved when converting Gifs to Webp and in reverse, and also when only resizing (https://github.com/TryGhost/Ghost/issues/13319)

**Favicons**
- Custom favicons are no longer served via `/favicon.png` or `/favicon.ico` (only for default favicon), but use their full path
- Added support for uploading more image extensions in Ghost as a favicon: .jpg, .jpeg, .gif, .webp and .svg are now supported (already supported .png and .ico).
- File extensions other than jpg/jpeg, png, or ico will always get transformed to the image/png format to guarantee browser support (webp and svg images are not yet supported as favicons by all browsers).

For all image formats, other than .ico files:
- Allowed to upload images larger than 1000px in width and height, they will get cropped to 256x256px.
- Allowed uploading favicons that are not square. They will get cropped automatically.
- Allowed to upload larger files, up to 20MB (will get served at a lower file size after being resized)

For .svg files:
- The minimum size of 60x60px is no longer required.

For .ico files:
- The file size limit is increased to 200kb (coming from 100kb)
2022-05-27 16:36:53 +02:00
..
test_tpl Updated content cta helper to use new tiers helper 2022-03-04 18:22:59 +05:30
asset.test.js 🎨 Reduced favicon requirements and added image formatting (#14918) 2022-05-27 16:36:53 +02:00
authors.test.js Moved URL service to backend 2021-10-19 07:29:09 +13:00
body_class.test.js Fixed frontend rendering of page resource 2022-05-16 22:06:55 +08:00
cancel_link.test.js
concat.test.js
content.test.js
date.test.js Added timezone and locale to the options of the date helper (#13892) 2022-01-19 14:43:53 +00:00
encode.test.js
excerpt.test.js Updated output logic to correctly use excerpt 2022-05-16 15:51:14 +01:00
facebook_url.test.js
foreach.test.js
get.test.js 🔥 Removed versioned APIs 2022-04-28 15:37:09 +01:00
ghost_foot.test.js
ghost_head.test.js 🎨 Reduced favicon requirements and added image formatting (#14918) 2022-05-27 16:36:53 +02:00
has.test.js
img_url.test.js
is.test.js
lang.test.js
link.test.js
link_class.test.js
match.test.js Added >, <, >=, and <= operators to match helper (#14215) 2022-03-03 15:43:47 +01:00
meta_description.test.js
meta_title.test.js
navigation.test.js
next_post.test.js 🔥 Removed versioned APIs 2022-04-28 15:37:09 +01:00
page_url.test.js
pagination.test.js
plural.test.js
post_class.test.js
prev_post.test.js 🔥 Removed versioned APIs 2022-04-28 15:37:09 +01:00
price.test.js
raw.test.js
reading_time.test.js
t.test.js Moved locale testing out of casper fixture (#13850) 2021-12-06 15:11:54 +00:00
tags.test.js Moved URL service to backend 2021-10-19 07:29:09 +13:00
tiers.test.js Fixed mockLabs disabling all other flags (#14621) 2022-04-28 10:55:20 +02:00
title.test.js
twitter_url.test.js
url.test.js 🔥 Removed support for http/https mixed mode (#14783) 2022-05-11 14:53:23 +01:00