heic
Some checks failed
deploy / deploy (push) Failing after 5s

This commit is contained in:
Untone 2024-11-13 09:24:10 +03:00
parent 455d66cfb2
commit 72c8250818
3 changed files with 6 additions and 11 deletions

View File

@ -7,8 +7,8 @@ RUN cat /etc/os-release
# Install necessary packages
RUN apk update && \
apk add git pkgconf make g++ openssl libheif libheif-dev tiff tiff-dev && \
rustup target add x86_64-unknown-linux-gnu
apk add git pkgconf make g++ openssl openssl-dev libheif libheif-dev tiff tiff-dev && \
rustup target add x86_64-unknown-linux-musl
# Create a new Rust binary project
RUN USER=root cargo new --bin quoter

View File

@ -35,14 +35,9 @@ pub async fn proxy_handler(
"png" => "image/png",
"webp" => "image/webp",
"gif" => "image/gif",
"heic" | "heif" | "tiff" | "tif" => {
// Для HEIC и TIFF файлов мы всё равно будем отдавать оригинальный content-type,
// но при сохранении миниатюр они будут конвертированы в JPEG
match ext.as_str() {
"heic" | "heif" => "image/heic",
_ => "image/tiff"
}
},
"jfif" => "image/jpeg",
"heic" | "heif" => "image/heic",
"tif" | "tiff" => "image/tiff",
"mp3" => "audio/mpeg",
"wav" => "audio/x-wav",
"ogg" => "audio/ogg",

View File

@ -132,7 +132,7 @@ pub async fn thumbdata_save(
// Определяем выходной формат
let output_ext = match ext.as_str() {
"heic" | "heif" | "tiff" | "tif" => "jpg", // Конвертируем HEIC и TIFF в JPEG
"heic" | "heif" => "jpg", // Конвертируем HEIC в JPEG
_ => &ext
};