mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-18 21:45:31 +09:00
fix(media-proxy): serve originals and speed up slow transforms (#3393)
This commit is contained in:
1 parent
44bc29b101
commit
aa3b058ce6
29 files changed
+632
-83
No files matched your search
@@ -7,6 +7,7 @@ use super::{
|
||||
MediaError, native_animated_frame_limit, native_buffer_to_media_bytes, native_status_error,
|
||||
};
|
||||
use crate::{
|
||||
constants,
|
||||
image_transform::ImageOptions,
|
||||
media_limits::MediaLimits,
|
||||
metrics::transform::TransformMetrics,
|
||||
@@ -176,6 +177,15 @@ pub(super) struct GifResizeDims {
|
||||
pub(super) height: c_int,
|
||||
}
|
||||
|
||||
impl GifResizeDims {
|
||||
pub(super) fn fits_work_budget(self, frames: c_int) -> bool {
|
||||
(self.width as usize)
|
||||
.saturating_mul(self.height as usize)
|
||||
.saturating_mul(frames.max(1) as usize)
|
||||
<= constants::MAX_GIF_RESIZE_OUTPUT_PIXELS
|
||||
}
|
||||
}
|
||||
|
||||
pub(super) fn gif_resize_dims(
|
||||
sniffed: mime::SniffInfo,
|
||||
options: &ImageOptions,
|
||||
|
||||
Reference in new issue
Block a user