Skip to content
This repository has been archived by the owner on Feb 19, 2022. It is now read-only.

Commit

Permalink
webp => avif
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red committed Dec 31, 2021
1 parent 41d4f9d commit f07aaf6
Show file tree
Hide file tree
Showing 185 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions client/src/utils/get_path.js
Expand Up @@ -3,7 +3,7 @@
* @returns {string}
*/
function getImagePath(imageId, small) {
return `/images/${imageId}${small ? '-2' : ''}.webp`;
return `/images/${imageId}${small ? '-2' : ''}.avif`;
}

/**
Expand Down Expand Up @@ -35,7 +35,7 @@ function getSoundMetaPath(soundId) {
* @returns {string}
*/
function getProfileImagePath(profileImageId) {
return `/images/profiles/${profileImageId}.webp`;
return `/images/profiles/${profileImageId}.avif`;
}

export { getImagePath, getMoviePath, getSoundPath, getSoundMetaPath, getProfileImagePath };
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
6 changes: 3 additions & 3 deletions server/convert_jpg2webp.js → server/convert_jpg2avif.js
Expand Up @@ -12,8 +12,8 @@ const dir = path.resolve(PUBLIC_PATH, './images')
for (const file of files) {
if (path.extname(file) !== '.jpg') continue

const newFile = `${path.basename(file, '.jpg')}.webp`
// const newFile = `${path.basename(file, '.jpg')}-2.webp`
const newFile = `${path.basename(file, '.jpg')}.avif`
// const newFile = `${path.basename(file, '.jpg')}-2.avif`

await sharp(path.resolve(dir, file))
.resize({
Expand All @@ -27,7 +27,7 @@ const dir = path.resolve(PUBLIC_PATH, './images')
// position: 'top',
// withoutEnlargement: true
// })
.toFormat('webp')
.toFormat('avif')
.toFile(path.resolve(dir, `./${newFile}`))

console.log(`outputed: ${newFile}`)
Expand Down
2 changes: 1 addition & 1 deletion server/package.json
Expand Up @@ -11,7 +11,7 @@
"prestart:clean": "rimraf ../upload",
"prestart:init": "mkdirp ../upload/images ../upload/movies ../upload/sounds",
"convert:movie": "babel-node --experimental-wasm-threads convert_gif2webm.js",
"convert:img": "babel-node convert_jpg2webp.js",
"convert:img": "babel-node convert_jpg2avif.js",
"generate:sound-meta": "babel-node --experimental-wasm-threads generate_sound_meta.js"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion server/src/converters/convert_image.js
Expand Up @@ -15,7 +15,7 @@ async function convertImage(buffer, options) {
height: options.height,
width: options.width,
})
.toFormat(options.extension ?? 'webp')
.toFormat(options.extension ?? 'avif')
.toBuffer();
}

Expand Down
2 changes: 1 addition & 1 deletion server/src/routes/api/image.js
Expand Up @@ -9,7 +9,7 @@ import { convertImage } from '../../converters/convert_image';
import { UPLOAD_PATH } from '../../paths';

// 変換した画像の拡張子
const EXTENSION = 'webp';
const EXTENSION = 'avif';

const router = Router();

Expand Down

0 comments on commit f07aaf6

Please sign in to comment.