Skip to content

A free and open source instant messaging and VoIP chat app built for friends, groups, and communities.

TypeScript fluxerfluxerapp

fix: scale large backdrops instead of failing (#3641)

Hampusf6263e8101d0
diff --git a/fluxer_admin/src/config/mod.rs b/fluxer_admin/src/config/mod.rs
index 71e2971ca..e41e35aed 100644
--- a/fluxer_admin/src/config/mod.rs
+++ b/fluxer_admin/src/config/mod.rs
@@ -105,9 +105,52 @@ impl AdminConfig {
}
pub fn admin_origin(&self) -> Option<String> {
- let origin = url::Url::parse(&self.admin_endpoint).ok()?.origin();
- origin.is_tuple().then(|| origin.ascii_serialization())
+ endpoint_origin(&self.admin_endpoint)
}
+
+ pub fn image_origins(&self) -> Vec<String> {
+ let api = if self.api_public_endpoint.is_empty() {
+ &self.api_endpoint
+ } else {
+ &self.api_public_endpoint
+ };
+ let mut origins = Vec::new();
+ for origin in [
+ &self.static_cdn_endpoint,
+ &self.media_endpoint,
+ &self.web_app_endpoint,
+ &self.reports_bucket_origin,
+ api,
+ ]
+ .into_iter()
+ .filter_map(|endpoint| endpoint_origin(endpoint))
+ {
+ if !origins.contains(&origin) {
+ origins.push(origin);
+ }
+ }
+ origins
+ }
+
+ pub fn shows_image(&self, image_url: &str) -> bool {
+ let Ok(url) = url::Url::parse(image_url) else {
+ return image_url.starts_with('/') && !image_url.starts_with("//");
+ };
+ if matches!(url.scheme(), "data" | "blob") {
+ return true;
+ }
+ let origin = url.origin();
+ if !origin.is_tuple() {
+ return false;
+ }
+ let origin = origin.ascii_serialization();
+ self.admin_origin().as_ref() == Some(&origin) || self.image_origins().contains(&origin)
+ }
+}
+
+fn endpoint_origin(endpoint: &str) -> Option<String> {
+ let origin = url::Url::parse(endpoint).ok()?.origin();
+ origin.is_tuple().then(|| origin.ascii_serialization())
}
fn reports_bucket_origin_from_env() -> String {
diff --git a/fluxer_admin/src/routes/auth.rs b/fluxer_admin/src/routes/auth.rs
index ffd1d715d..2fcaeabda 100644
--- a/fluxer_admin/src/routes/auth.rs
+++ b/fluxer_admin/src/routes/auth.rs
@@ -27,7 +27,7 @@ use std::time::{SystemTime, UNIX_EPOCH};
type HmacSha256 = Hmac<Sha256>;
-const OAUTH_STATE_MAX_AGE_SECONDS: u64 = 300;
+const OAUTH_STATE_MAX_AGE_SECONDS: u64 = 1800;
const OAUTH_STATE_NONCE_BYTES: usize = 16;
const OAUTH_STATE_VERIFIER_HASH_BYTES: usize = 32;
const OAUTH_STATE_PAYLOAD_BYTES: usize =
@@ -483,3 +483,20 @@ fn now_seconds() -> u64 {
.expect("system clock before Unix epoch")
.as_secs()
}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+
+ #[test]
+ fn oauth_state_survives_ten_minutes_on_the_consent_page() {
+ let verifier = "verifier";
+ let issued = |age: u64| sign_oauth_state("secret", now_seconds() - age, [7; 16], verifier);
+ assert!(verify_oauth_state("secret", &issued(10 * 60), verifier));
+ assert!(!verify_oauth_state(
+ "secret",
+ &issued(OAUTH_STATE_MAX_AGE_SECONDS + 60),
+ verifier
+ ));
+ }
+}
diff --git a/fluxer_admin/src/routes/mod.rs b/fluxer_admin/src/routes/mod.rs
index 5d0d2d744..a9a4840a5 100644
--- a/fluxer_admin/src/routes/mod.rs
+++ b/fluxer_admin/src/routes/mod.rs
@@ -139,26 +139,8 @@ async fn security_headers_middleware(
}
fn build_admin_csp(config: &AdminConfig) -> String {
- let api = if config.api_public_endpoint.is_empty() {
- &config.api_endpoint
- } else {
- &config.api_public_endpoint
- };
let mut img_sources = vec!["'self'".to_owned(), "data:".to_owned(), "blob:".to_owned()];
- for source in [
- csp_origin(&config.static_cdn_endpoint),
- csp_origin(&config.media_endpoint),
- csp_origin(&config.web_app_endpoint),
- csp_origin(&config.reports_bucket_origin),
- csp_origin(api),
- ]
- .into_iter()
- .flatten()
- {
- if !img_sources.contains(&source) {
- img_sources.push(source);
- }
- }
+ img_sources.extend(config.image_origins());
[
"default-src 'self'".to_owned(),
"script-src 'self' 'unsafe-inline'".to_owned(),
@@ -175,11 +157,6 @@ fn build_admin_csp(config: &AdminConfig) -> String {
.join("; ")
}
-fn csp_origin(endpoint: &str) -> Option<String> {
- let origin = url::Url::parse(endpoint).ok()?.origin();
- origin.is_tuple().then(|| origin.ascii_serialization())
-}
-
async fn cache_headers_middleware(request: Request, next: Next) -> Response {
let mut response = next.run(request).await;
if response.headers().contains_key(header::CACHE_CONTROL) {
diff --git a/fluxer_admin/src/routes/system_actions/branding_assets.rs b/fluxer_admin/src/routes/system_actions/branding_assets.rs
index cc1b18f6b..30341a39d 100644
--- a/fluxer_admin/src/routes/system_actions/branding_assets.rs
+++ b/fluxer_admin/src/routes/system_actions/branding_assets.rs
@@ -56,6 +56,7 @@ pub(super) async fn post(
) {
return render_fragment_with_toast(
templates::pages::instance_branding::branding_asset_field(
+ config,
kind,
kind.url(&instance_config.app_public.branding),
),
diff --git a/fluxer_admin/src/templates/pages/instance_branding.rs b/fluxer_admin/src/templates/pages/instance_branding.rs
index 009bf6d92..fc32fcfef 100644
--- a/fluxer_admin/src/templates/pages/instance_branding.rs
+++ b/fluxer_admin/src/templates/pages/instance_branding.rs
@@ -6,6 +6,7 @@ use crate::{
AppPublicConfigResponse, BRANDING_ASSET_ACCEPT, BRANDING_ASSET_MAX_IMAGE_CHARS,
BrandingAssetKind, CUSTOM_CSS_MAX_CHARS,
},
+ config::AdminConfig,
templates::components::form::{
Checkbox, FORM_LABEL_CLASS, FORM_TEXTAREA_CLASS, form_actions, submit_button, text_input,
textarea_input,
@@ -70,17 +71,18 @@ fn asset_guidance(kind: BrandingAssetKind) -> AssetGuidance {
}
pub(super) fn branding_section(
- base: &str,
+ config: &AdminConfig,
config_form: ConfigForm<'_>,
app_public: &AppPublicConfigResponse,
host: &str,
) -> Markup {
+ let base = &config.base_path;
html! {
form method="post" action={(base) "/instance-config?action=update_app_public"} data-branding-form {
(config_form.fields())
div class="grid grid-cols-1 gap-8 xl:grid-cols-[minmax(0,27rem)_minmax(0,1fr)] xl:items-start" {
div class="min-w-0 xl:sticky xl:top-6 xl:col-start-2 xl:row-start-1" {
- (branding_preview(host))
+ (branding_preview(host, &config.image_origins()))
}
div class="min-w-0 space-y-6 xl:col-start-1 xl:row-start-1" {
div class="flex flex-col gap-2" {
@@ -108,7 +110,7 @@ pub(super) fn branding_section(
div class="space-y-4 border-t border-neutral-200 pt-6" {
h3 class="text-sm font-semibold text-neutral-900" { "Images" }
@for kind in ASSET_ORDER {
- (branding_asset_field(kind, kind.url(&app_public.branding)))
+ (branding_asset_field(config, kind, kind.url(&app_public.branding)))
}
}
div class="flex flex-col gap-2 border-t border-neutral-200 pt-6" {
@@ -220,7 +222,11 @@ pub fn branding_asset_field_id(kind: BrandingAssetKind) -> String {
format!("branding-asset-{}", kind.as_str())
}
-pub fn branding_asset_field(kind: BrandingAssetKind, url: Option<&str>) -> Markup {
+pub fn branding_asset_field(
+ config: &AdminConfig,
+ kind: BrandingAssetKind,
+ url: Option<&str>,
+) -> Markup {
let name = format!("app_{}_url", kind.as_str());
let placeholder = match kind {
BrandingAssetKind::Favicon => "https://example.com/favicon.ico".to_owned(),
@@ -228,6 +234,10 @@ pub fn branding_asset_field(kind: BrandingAssetKind, url: Option<&str>) -> Marku
_ => format!("https://example.com/{}.png", kind.as_str()),
};
let guidance = asset_guidance(kind);
+ let failed_note = match url {
+ Some(url) if config.shows_image(url) => UNLOADABLE_IMAGE_NOTE,
+ _ => UNPREVIEWABLE_IMAGE_NOTE,
+ };
let thumbnail_class = if kind == BrandingAssetKind::SignInBackdrop {
"h-16 w-28"
} else {
@@ -274,7 +284,7 @@ pub fn branding_asset_field(kind: BrandingAssetKind, url: Option<&str>) -> Marku
p class="text-xs leading-5 text-neutral-500" { (guidance.empty) }
} @else {
p class="text-xs leading-5 text-neutral-500" data-branding-asset-unpreviewable hidden {
- (UNPREVIEWABLE_IMAGE_NOTE)
+ (failed_note)
}
}
(text_input(&name, &format!("{} URL", kind.label()), url.unwrap_or(""), &placeholder))
@@ -282,9 +292,10 @@ pub fn branding_asset_field(kind: BrandingAssetKind, url: Option<&str>) -> Marku
}
}
-fn branding_preview(host: &str) -> Markup {
+fn branding_preview(host: &str, image_origins: &[String]) -> Markup {
+ let image_origins = serde_json::to_string(image_origins).unwrap_or_else(|_| "[]".to_owned());
html! {
- div class="bp-root" data-branding-preview {
+ div class="bp-root" data-branding-preview data-bp-image-origins=(image_origins) {
div class="bp-tabs" role="tablist" aria-label="Preview" {
button type="button" role="tab" class="bp-tab" aria-selected="true" data-bp-tab="sign_in" { "Sign-in page" }
button type="button" role="tab" class="bp-tab" aria-selected="false" tabindex="-1" data-bp-tab="phone" { "Phone" }
@@ -292,6 +303,7 @@ fn branding_preview(host: &str) -> Markup {
button type="button" role="tab" class="bp-tab" aria-selected="false" tabindex="-1" data-bp-tab="instances" { "Instance list" }
}
p class="bp-note" data-bp="unpreviewable-note" hidden { (UNPREVIEWABLE_PREVIEW_NOTE) }
+ p class="bp-note" data-bp="unloadable-note" hidden { (UNLOADABLE_PREVIEW_NOTE) }
div class="bp-stage" {
div role="tabpanel" data-bp-panel="sign_in" {
div class="bp-computer" aria-hidden="true" {
@@ -435,6 +447,12 @@ fn titlebar_group(title: &str, macos: bool) -> Markup {
const UNPREVIEWABLE_IMAGE_NOTE: &str = "This image can't be previewed here. The admin panel only shows images stored on this instance.";
+const UNLOADABLE_IMAGE_NOTE: &str =
+ "This image could not be loaded from this instance. Try uploading it again.";
+
+const UNLOADABLE_PREVIEW_NOTE: &str =
+ "Some images could not be loaded from this instance, so a gray square stands in for them.";
+
const UNPREVIEWABLE_PREVIEW_NOTE: &str = "Some images can't be previewed here. The admin panel only shows images stored on this instance, so a gray square stands in for them.";
const THUMBNAIL_ONERROR: &str = "this.hidden=true;this.closest('[data-branding-asset]').querySelectorAll('[data-branding-asset-placeholder],[data-branding-asset-unpreviewable]').forEach(function(el){el.hidden=false})";
@@ -591,12 +609,14 @@ const BRANDING_PREVIEW_SCRIPT: &str = r#"
if (img.getAttribute('data-bp-src') !== url) {
img.setAttribute('data-bp-src', url);
img.removeAttribute('data-bp-unpreviewable');
+ img.removeAttribute('data-bp-unloadable');
img.setAttribute('src', url);
}
img.hidden = false;
} else {
img.removeAttribute('data-bp-src');
img.removeAttribute('data-bp-unpreviewable');
+ img.removeAttribute('data-bp-unloadable');
img.removeAttribute('src');
img.hidden = true;
}
@@ -605,12 +625,29 @@ const BRANDING_PREVIEW_SCRIPT: &str = r#"
function showUnpreviewableNote() {
var root = document.querySelector('[data-branding-preview]');
show('[data-bp="unpreviewable-note"]', Boolean(root && root.querySelector('img[data-bp-unpreviewable]:not([hidden])')));
+ show('[data-bp="unloadable-note"]', Boolean(root && root.querySelector('img[data-bp-unloadable]:not([hidden])')));
+ }
+ function isInstanceImage(url) {
+ var root = document.querySelector('[data-branding-preview]');
+ var origins = [];
+ try {
+ origins = JSON.parse((root && root.getAttribute('data-bp-image-origins')) || '[]');
+ } catch (error) {
+ origins = [];
+ }
+ try {
+ var parsed = new URL(url, window.location.href);
+ if (parsed.protocol === 'data:' || parsed.protocol === 'blob:') return true;
+ return parsed.origin === window.location.origin || origins.indexOf(parsed.origin) !== -1;
+ } catch (error) {
+ return false;
+ }
}
function markUnpreviewable(event) {
var img = event.target;
if (!(img instanceof HTMLImageElement) || !img.hasAttribute('data-bp-src') || !img.closest('[data-branding-preview]')) return;
- if (img.hasAttribute('data-bp-unpreviewable')) return;
- img.setAttribute('data-bp-unpreviewable', '');
+ if (img.hasAttribute('data-bp-unpreviewable') || img.hasAttribute('data-bp-unloadable')) return;
+ img.setAttribute(isInstanceImage(img.getAttribute('data-bp-src')) ? 'data-bp-unloadable' : 'data-bp-unpreviewable', '');
img.setAttribute('src', PLACEHOLDER);
showUnpreviewableNote();
}
diff --git a/fluxer_admin/src/templates/pages/instance_config.rs b/fluxer_admin/src/templates/pages/instance_config.rs
index ae04a337b..61b4e0d8a 100644
--- a/fluxer_admin/src/templates/pages/instance_config.rs
+++ b/fluxer_admin/src/templates/pages/instance_config.rs
@@ -388,7 +388,7 @@ fn app_public_config_section(
"The name, color and images people see on the sign-in page, in the apps and in the browser. The preview shows each place they are used.",
html! {
div class="space-y-8" {
- (branding_section(base, config_form, app_public, &host))
+ (branding_section(config, config_form, app_public, &host))
div class="space-y-4 border-t border-neutral-200 pt-6" {
h3 class="text-sm font-semibold text-neutral-900" { "Legal Documents" }
form method="post" action={(base) "/instance-config?action=update_app_legal"} {
diff --git a/fluxer_app/src/features/app/components/setup/SetupBrandingAssetField.tsx b/fluxer_app/src/features/app/components/setup/SetupBrandingAssetField.tsx
index 9d3b58551..3839b12e0 100644
--- a/fluxer_app/src/features/app/components/setup/SetupBrandingAssetField.tsx
+++ b/fluxer_app/src/features/app/components/setup/SetupBrandingAssetField.tsx
@@ -79,6 +79,11 @@ const ERROR_NOT_SAVED_DESCRIPTOR = msg({
comment:
'Error on a branding image field in the setup wizard when saving the image failed. "Continue" is the label of the button that saves the step.',
});
+const ERROR_NOT_LOADED_DESCRIPTOR = msg({
+ message: 'This image could not be loaded after saving. Press "Continue" to try again, or choose a different file.',
+ comment:
+ 'Error on a branding image field in the setup wizard when the image was uploaded but loading it from the server failed. "Continue" is the label of the button that saves the step.',
+});
const MORE_ABOUT_IMAGE_DESCRIPTOR = msg({
message: 'More about this image',
comment:
@@ -340,6 +345,9 @@ export const BrandingAssetField = observer(
case 'not_saved':
errorText = i18n._(ERROR_NOT_SAVED_DESCRIPTOR);
break;
+ case 'not_loaded':
+ errorText = i18n._(ERROR_NOT_LOADED_DESCRIPTOR);
+ break;
}
const warnings: Array<string> = [];
if (tooSmall) warnings.push(i18n._(ASSET_SMALL_DESCRIPTOR));
diff --git a/fluxer_app/src/features/app/components/setup/SetupBrandingDraft.tsx b/fluxer_app/src/features/app/components/setup/SetupBrandingDraft.tsx
index ffdab9a8c..01a643cfe 100644
--- a/fluxer_app/src/features/app/components/setup/SetupBrandingDraft.tsx
+++ b/fluxer_app/src/features/app/components/setup/SetupBrandingDraft.tsx
@@ -15,7 +15,7 @@ const BRANDING_ASSET_KINDS: ReadonlyArray<SetupBrandingAssetKind> = [
'favicon_dark',
];
-export type BrandingAssetError = 'too_large' | 'unsupported' | 'unreadable' | 'not_saved';
+export type BrandingAssetError = 'too_large' | 'unsupported' | 'unreadable' | 'not_saved' | 'not_loaded';
export interface BrandingAssetState {
kind: SetupBrandingAssetKind;
@@ -36,7 +36,7 @@ export function validateBrandingFile(kind: SetupBrandingAssetKind, file: File):
if (!Object.values(policy.mimes).includes(file.type) && !isExtensionAllowed(policyKind, extension)) {
return 'unsupported';
}
- if (file.size > policy.maxBytes) {
+ if (kind !== 'sign_in_backdrop' && file.size > policy.maxBytes) {
return 'too_large';
}
return null;
diff --git a/fluxer_app/src/features/app/components/setup/SetupBrandingFields.tsx b/fluxer_app/src/features/app/components/setup/SetupBrandingFields.tsx
index 40ec6ff08..9c94b6c17 100644
--- a/fluxer_app/src/features/app/components/setup/SetupBrandingFields.tsx
+++ b/fluxer_app/src/features/app/components/setup/SetupBrandingFields.tsx
@@ -445,7 +445,7 @@ export const BrandingFields = observer(
if (disabled || handledError.current === error) return;
handledError.current = error;
const failed = stepRef.current?.querySelector<HTMLElement>(
- '[data-branding-error="not_saved"] button[data-flx^="app.self-hosted-setup-wizard-gate.asset-"]:not(:disabled)',
+ ':is([data-branding-error="not_saved"], [data-branding-error="not_loaded"]) button[data-flx^="app.self-hosted-setup-wizard-gate.asset-"]:not(:disabled)',
);
if (failed) {
failed.focus();
diff --git a/fluxer_app/src/features/app/components/setup/SetupBrandingStep.tsx b/fluxer_app/src/features/app/components/setup/SetupBrandingStep.tsx
index 514c99d02..bea62c012 100644
--- a/fluxer_app/src/features/app/components/setup/SetupBrandingStep.tsx
+++ b/fluxer_app/src/features/app/components/setup/SetupBrandingStep.tsx
@@ -1,5 +1,6 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
+import {ASSET_COPY} from '@app/features/app/components/setup/SetupBrandingAssetField';
import {
brandingAssetPolicyKind,
brandingAssetUrl,
@@ -12,18 +13,40 @@ import {
type updateInstanceConfig,
uploadBrandingAsset,
} from '@app/features/app/components/setup/SetupWizardClient';
+import {fitImageWithin, ImageOptimizationSizeError} from '@app/features/expressions/utils/ImageCropUtils';
import {openFilePicker} from '@app/features/messaging/utils/FilePickerUtils';
import {Logger} from '@app/features/platform/utils/AppLogger';
import {readBlobAsDataUrl as fileToBase64} from '@app/features/platform/utils/BlobDataUrl';
import {int2hex} from '@app/features/theme/utils/ColorUtils';
import * as FormUtils from '@app/lib/forms';
-import {getAcceptString} from '@fluxer/constants/src/AssetFormatPolicy';
+import {getAcceptString, getPolicy} from '@fluxer/constants/src/AssetFormatPolicy';
import type {InstanceConfigResponse} from '@fluxer/schema/src/domains/admin/AdminSchemas';
+import {msg} from '@lingui/core/macro';
import {useLingui} from '@lingui/react/macro';
import {observer} from 'mobx-react-lite';
import {type RefObject, useCallback} from 'react';
const logger = new Logger('SelfHostedSetupWizardGate');
+const IMAGE_NOT_LOADED_DESCRIPTOR = msg({
+ message: '"{label}" was saved but could not be loaded back.',
+ comment:
+ 'Error at the bottom of the setup wizard branding step when an uploaded image could not be loaded from the server. label is the name of the image field, such as Sign-in background.',
+});
+
+function imageLoads(url: string): Promise<boolean> {
+ return new Promise((resolve) => {
+ const image = new Image();
+ image.onload = () => resolve(true);
+ image.onerror = () => resolve(false);
+ image.src = url;
+ });
+}
+
+async function prepareBrandingImage(kind: SetupBrandingAssetKind, file: File): Promise<Blob> {
+ if (kind !== 'sign_in_backdrop') return file;
+ const policy = getPolicy(brandingAssetPolicyKind(kind));
+ return fitImageWithin(file, policy.dims?.max ?? Number.POSITIVE_INFINITY, policy.maxBytes);
+}
interface BrandingStepProps {
config: InstanceConfigResponse | null;
@@ -49,8 +72,15 @@ export const BrandingStep = observer(
if (image === undefined) continue;
try {
const next = await uploadBrandingAsset(asset.kind, image);
- updateAsset(asset.kind, {url: brandingAssetUrl(next, asset.kind), preview: null, error: null});
+ const url = brandingAssetUrl(next, asset.kind);
onConfigUpdate(next);
+ if (url !== null && !(await imageLoads(url))) {
+ logger.error('A saved branding image could not be loaded back', {kind: asset.kind, url});
+ updateAsset(asset.kind, {url, error: 'not_loaded'});
+ onError(i18n._(IMAGE_NOT_LOADED_DESCRIPTOR, {label: i18n._(ASSET_COPY[asset.kind].label)}));
+ return;
+ }
+ updateAsset(asset.kind, {url, preview: null, error: null});
} catch (error) {
logger.error('Failed to upload a branding image', error);
updateAsset(asset.kind, {error: 'not_saved'});
@@ -77,11 +107,14 @@ export const BrandingStep = observer(
}
updateAsset(kind, {reading: true, error: null});
try {
- const dataUrl = await fileToBase64(file);
+ const dataUrl = await fileToBase64(await prepareBrandingImage(kind, file));
updateAsset(kind, {preview: dataUrl, reading: false});
} catch (readError) {
logger.error('Failed to read branding asset file', readError);
- updateAsset(kind, {reading: false, error: 'unreadable'});
+ updateAsset(kind, {
+ reading: false,
+ error: readError instanceof ImageOptimizationSizeError ? 'too_large' : 'unreadable',
+ });
}
},
[updateAsset],
diff --git a/fluxer_app/src/features/expressions/utils/ImageCropUtils.ts b/fluxer_app/src/features/expressions/utils/ImageCropUtils.ts
index 0adbc1e55..b7dca2f31 100644
--- a/fluxer_app/src/features/expressions/utils/ImageCropUtils.ts
+++ b/fluxer_app/src/features/expressions/utils/ImageCropUtils.ts
@@ -104,8 +104,44 @@ async function containToSquareBase64(
URL.revokeObjectURL(objectUrl);
}
- const hasTransparency = canvasHasTransparentPixels(ctx, target);
- const attempts: Array<{mime: StaticOutputMime; quality?: number}> = [{mime: preferredMime}];
+ return readBlobAsBase64NoPrefix(await encodeCanvasWithinBytes(canvas, ctx, preferredMime, maxBytes));
+}
+
+export async function fitImageWithin(file: File, maxSide: number, maxBytes: number): Promise<Blob> {
+ const objectUrl = URL.createObjectURL(file);
+ let img: HTMLImageElement;
+ try {
+ img = await loadImageElement(objectUrl);
+ } finally {
+ URL.revokeObjectURL(objectUrl);
+ }
+ const {naturalWidth: width, naturalHeight: height} = img;
+ if (width === 0 || height === 0) throw new Error('Failed to load image');
+ if (Math.max(width, height) <= maxSide && file.size <= maxBytes) return file;
+ if (width * height > SOURCE_MAX_PIXELS) {
+ throw new Error(`Image is too large to process (${width}x${height})`);
+ }
+ const scale = Math.min(1, maxSide / Math.max(width, height));
+ const canvas = document.createElement('canvas');
+ canvas.width = Math.max(1, Math.round(width * scale));
+ canvas.height = Math.max(1, Math.round(height * scale));
+ const ctx = canvas.getContext('2d');
+ if (!ctx) throw new Error('Could not create canvas context');
+ ctx.imageSmoothingEnabled = true;
+ ctx.imageSmoothingQuality = 'high';
+ ctx.drawImage(img, 0, 0, canvas.width, canvas.height);
+ return encodeCanvasWithinBytes(canvas, ctx, 'image/webp', maxBytes);
+}
+
+async function encodeCanvasWithinBytes(
+ canvas: HTMLCanvasElement,
+ ctx: CanvasRenderingContext2D,
+ preferredMime: StaticOutputMime,
+ maxBytes: number,
+): Promise<Blob> {
+ const hasTransparency = canvasHasTransparentPixels(ctx, canvas.width, canvas.height);
+ const attempts: Array<{mime: StaticOutputMime; quality?: number}> =
+ preferredMime === 'image/webp' ? [] : [{mime: preferredMime}];
for (const quality of WEBP_QUALITY_STEPS) attempts.push({mime: 'image/webp', quality});
if (!hasTransparency) {
for (const quality of JPEG_QUALITY_STEPS) attempts.push({mime: 'image/jpeg', quality});
@@ -120,7 +156,7 @@ async function containToSquareBase64(
smallestBlob = blob;
}
if (blob.size <= maxBytes) {
- return readBlobAsBase64NoPrefix(blob);
+ return blob;
}
}
if (smallestBlob) {
@@ -135,9 +171,9 @@ function encodeCanvas(canvas: HTMLCanvasElement, mime: StaticOutputMime, quality
});
}
-function canvasHasTransparentPixels(ctx: CanvasRenderingContext2D, target: number): boolean {
+function canvasHasTransparentPixels(ctx: CanvasRenderingContext2D, width: number, height: number): boolean {
try {
- const {data} = ctx.getImageData(0, 0, target, target);
+ const {data} = ctx.getImageData(0, 0, width, height);
for (let i = 3; i < data.length; i += 4) {
if ((data[i] ?? 255) < 255) return true;
}
diff --git a/fluxer_app/src/features/i18n/locales/ar/messages.po b/fluxer_app/src/features/i18n/locales/ar/messages.po
index a22186d43..fa77c1592 100644
--- a/fluxer_app/src/features/i18n/locales/ar/messages.po
+++ b/fluxer_app/src/features/i18n/locales/ar/messages.po
@@ -19,6 +19,11 @@ msgstr ""
msgid "... turn dense mode on. Nice!"
msgstr "... تشغيل الوضع المكثف. رائع!"
+#. Error at the bottom of the setup wizard branding step when an uploaded image could not be loaded from the server. label is the name of the image field, such as Sign-in background.
+#: src/features/app/components/setup/SetupBrandingStep.tsx
+msgid "\"{label}\" was saved but could not be loaded back."
+msgstr "تم حفظ \"{label}\" ولكن تعذر تحميله مرة أخرى."
+
#. Button or menu action label in the channel and chat user message. Keep it concise.
#. Suffix after the message text in the forward modal preview when the forwarded message was edited.
#: src/features/channel/components/MessageAttachments.tsx
@@ -36435,6 +36440,11 @@ msgstr "لم يتم تمييز هذه المجموعة بالمحتوى غير
msgid "This handoff code has expired. Generate a new one to continue."
msgstr "انتهت صلاحية رمز التسليم هذا. أنشئ رمزًا جديدًا للمتابعة."
+#. Error on a branding image field in the setup wizard when the image was uploaded but loading it from the server failed. "Continue" is the label of the button that saves the step.
+#: src/features/app/components/setup/SetupBrandingAssetField.tsx
+msgid "This image could not be loaded after saving. Press \"Continue\" to try again, or choose a different file."
+msgstr "تعذّر تحميل هذه الصورة بعد الحفظ. اضغط على \"متابعة\" للمحاولة مرة أخرى، أو اختر ملفًا آخر."
+
#. Error modal body shown when an animated image fails to decode during cropping.
#: src/features/messaging/components/modals/ImageCropModal.tsx
msgid "This image couldn't be read. It may be damaged."
diff --git a/fluxer_app/src/features/i18n/locales/bg/messages.po b/fluxer_app/src/features/i18n/locales/bg/messages.po
index e7f900326..d862b7a89 100644
--- a/fluxer_app/src/features/i18n/locales/bg/messages.po
+++ b/fluxer_app/src/features/i18n/locales/bg/messages.po
@@ -19,6 +19,11 @@ msgstr ""
msgid "... turn dense mode on. Nice!"
msgstr "... включиш сбития режим. Супер!"
+#. Error at the bottom of the setup wizard branding step when an uploaded image could not be loaded from the server. label is the name of the image field, such as Sign-in background.
+#: src/features/app/components/setup/SetupBrandingStep.tsx
+msgid "\"{label}\" was saved but could not be loaded back."
+msgstr "\"{label}\" беше запазено, но не можа да бъде заредено обратно."
+
#. Button or menu action label in the channel and chat user message. Keep it concise.
#. Suffix after the message text in the forward modal preview when the forwarded message was edited.
#: src/features/channel/components/MessageAttachments.tsx
@@ -36435,6 +36440,11 @@ msgstr "Тази група не е маркирана като съдържащ
msgid "This handoff code has expired. Generate a new one to continue."
msgstr "Този код за прехвърляне е изтекъл. Генерирай нов, за да продължиш."
+#. Error on a branding image field in the setup wizard when the image was uploaded but loading it from the server failed. "Continue" is the label of the button that saves the step.
+#: src/features/app/components/setup/SetupBrandingAssetField.tsx
+msgid "This image could not be loaded after saving. Press \"Continue\" to try again, or choose a different file."
+msgstr "Това изображение не можа да бъде заредено след запазване. Натиснете „Продължи“, за да опитате отново, или изберете друг файл."
+
#. Error modal body shown when an animated image fails to decode during cropping.
#: src/features/messaging/components/modals/ImageCropModal.tsx
msgid "This image couldn't be read. It may be damaged."
diff --git a/fluxer_app/src/features/i18n/locales/cs/messages.po b/fluxer_app/src/features/i18n/locales/cs/messages.po
index 5e7e81a45..6758425c5 100644
--- a/fluxer_app/src/features/i18n/locales/cs/messages.po
+++ b/fluxer_app/src/features/i18n/locales/cs/messages.po
@@ -19,6 +19,11 @@ msgstr ""
msgid "... turn dense mode on. Nice!"
msgstr "... zapnout zhuštěný režim. Super!"
+#. Error at the bottom of the setup wizard branding step when an uploaded image could not be loaded from the server. label is the name of the image field, such as Sign-in background.
+#: src/features/app/components/setup/SetupBrandingStep.tsx
+msgid "\"{label}\" was saved but could not be loaded back."
+msgstr "\"{label}\" byl uložen, ale nepodařilo se ho znovu načíst."
+
#. Button or menu action label in the channel and chat user message. Keep it concise.
#. Suffix after the message text in the forward modal preview when the forwarded message was edited.
#: src/features/channel/components/MessageAttachments.tsx
@@ -36435,6 +36440,11 @@ msgstr "Tato skupina není označena jako obsah pro dospělé. Vlastník skupiny
msgid "This handoff code has expired. Generate a new one to continue."
msgstr "Tento kód pro předání vypršel. Vygenerujte si nový, abyste mohli pokračovat."
+#. Error on a branding image field in the setup wizard when the image was uploaded but loading it from the server failed. "Continue" is the label of the button that saves the step.
+#: src/features/app/components/setup/SetupBrandingAssetField.tsx
+msgid "This image could not be loaded after saving. Press \"Continue\" to try again, or choose a different file."
+msgstr "Tento obrázek se po uložení nepodařilo načíst. Stiskněte „Pokračovat“ pro opakování, nebo vyberte jiný soubor."
+
#. Error modal body shown when an animated image fails to decode during cropping.
#: src/features/messaging/components/modals/ImageCropModal.tsx
msgid "This image couldn't be read. It may be damaged."
diff --git a/fluxer_app/src/features/i18n/locales/da/messages.po b/fluxer_app/src/features/i18n/locales/da/messages.po
index aaa47b03f..96ac0d02e 100644
--- a/fluxer_app/src/features/i18n/locales/da/messages.po
+++ b/fluxer_app/src/features/i18n/locales/da/messages.po
@@ -19,6 +19,11 @@ msgstr ""
msgid "... turn dense mode on. Nice!"
msgstr "... slå kompakt visning til. Fedt!"
+#. Error at the bottom of the setup wizard branding step when an uploaded image could not be loaded from the server. label is the name of the image field, such as Sign-in background.
+#: src/features/app/components/setup/SetupBrandingStep.tsx
+msgid "\"{label}\" was saved but could not be loaded back."
+msgstr "\"{label}\" blev gemt, men kunne ikke indlæses igen."
+
#. Button or menu action label in the channel and chat user message. Keep it concise.
#. Suffix after the message text in the forward modal preview when the forwarded message was edited.
#: src/features/channel/components/MessageAttachments.tsx
@@ -36435,6 +36440,11 @@ msgstr "Denne gruppe er ikke markeret som modent indhold. Gruppens ejer kan slå
msgid "This handoff code has expired. Generate a new one to continue."
msgstr "Denne overdragelseskode er udløbet. Generer en ny for at fortsætte."
+#. Error on a branding image field in the setup wizard when the image was uploaded but loading it from the server failed. "Continue" is the label of the button that saves the step.
+#: src/features/app/components/setup/SetupBrandingAssetField.tsx
+msgid "This image could not be loaded after saving. Press \"Continue\" to try again, or choose a different file."
+msgstr "Billedet kunne ikke indlæses efter gemning. Tryk på \"Fortsæt\" for at prøve igen, eller vælg en anden fil."
+
#. Error modal body shown when an animated image fails to decode during cropping.
#: src/features/messaging/components/modals/ImageCropModal.tsx
msgid "This image couldn't be read. It may be damaged."
diff --git a/fluxer_app/src/features/i18n/locales/de/messages.po b/fluxer_app/src/features/i18n/locales/de/messages.po
index e033bc885..3523809e9 100644
--- a/fluxer_app/src/features/i18n/locales/de/messages.po
+++ b/fluxer_app/src/features/i18n/locales/de/messages.po
@@ -19,6 +19,11 @@ msgstr ""
msgid "... turn dense mode on. Nice!"
msgstr "... den Kompaktmodus aktivieren. Super!"
+#. Error at the bottom of the setup wizard branding step when an uploaded image could not be loaded from the server. label is the name of the image field, such as Sign-in background.
+#: src/features/app/components/setup/SetupBrandingStep.tsx
+msgid "\"{label}\" was saved but could not be loaded back."
+msgstr "\"{label}\" wurde gespeichert, konnte aber nicht erneut geladen werden."
+
#. Button or menu action label in the channel and chat user message. Keep it concise.
#. Suffix after the message text in the forward modal preview when the forwarded message was edited.
#: src/features/channel/components/MessageAttachments.tsx
@@ -36435,6 +36440,11 @@ msgstr "Diese Gruppe ist nicht für Inhalte für Erwachsene markiert. Der Gruppe
msgid "This handoff code has expired. Generate a new one to continue."
msgstr "Dieser Übergabecode ist abgelaufen. Erstelle einen neuen, um fortzufahren."
+#. Error on a branding image field in the setup wizard when the image was uploaded but loading it from the server failed. "Continue" is the label of the button that saves the step.
+#: src/features/app/components/setup/SetupBrandingAssetField.tsx
+msgid "This image could not be loaded after saving. Press \"Continue\" to try again, or choose a different file."
+msgstr "Dieses Bild konnte nach dem Speichern nicht geladen werden. Drücke „Weiter“, um es erneut zu versuchen, oder wähle eine andere Datei aus."
+
#. Error modal body shown when an animated image fails to decode during cropping.
#: src/features/messaging/components/modals/ImageCropModal.tsx
msgid "This image couldn't be read. It may be damaged."
diff --git a/fluxer_app/src/features/i18n/locales/el/messages.po b/fluxer_app/src/features/i18n/locales/el/messages.po
index c6bd9690d..cd89ea064 100644
--- a/fluxer_app/src/features/i18n/locales/el/messages.po
+++ b/fluxer_app/src/features/i18n/locales/el/messages.po
@@ -19,6 +19,11 @@ msgstr ""
msgid "... turn dense mode on. Nice!"
msgstr "...ενεργοποιήσεις την πυκνή λειτουργία. Ωραία!"
+#. Error at the bottom of the setup wizard branding step when an uploaded image could not be loaded from the server. label is the name of the image field, such as Sign-in background.
+#: src/features/app/components/setup/SetupBrandingStep.tsx
+msgid "\"{label}\" was saved but could not be loaded back."
+msgstr "Το \"{label}\" αποθηκεύτηκε αλλά δεν ήταν δυνατή η φόρτωσή του."
+
#. Button or menu action label in the channel and chat user message. Keep it concise.
#. Suffix after the message text in the forward modal preview when the forwarded message was edited.
#: src/features/channel/components/MessageAttachments.tsx
@@ -36435,6 +36440,11 @@ msgstr "Αυτή η ομάδα δεν έχει επισημανθεί για π
msgid "This handoff code has expired. Generate a new one to continue."
msgstr "Αυτός ο κωδικός παράδοσης έχει λήξει. Δημιουργήστε έναν νέο για να συνεχίσετε."
+#. Error on a branding image field in the setup wizard when the image was uploaded but loading it from the server failed. "Continue" is the label of the button that saves the step.
+#: src/features/app/components/setup/SetupBrandingAssetField.tsx
+msgid "This image could not be loaded after saving. Press \"Continue\" to try again, or choose a different file."
+msgstr "Αυτή η εικόνα δεν φορτώθηκε μετά την αποθήκευση. Πάτησε «Συνέχεια» για να δοκιμάσεις ξανά ή επίλεξε άλλο αρχείο."
+
#. Error modal body shown when an animated image fails to decode during cropping.
#: src/features/messaging/components/modals/ImageCropModal.tsx
msgid "This image couldn't be read. It may be damaged."
diff --git a/fluxer_app/src/features/i18n/locales/en-GB/messages.po b/fluxer_app/src/features/i18n/locales/en-GB/messages.po
index 0fef54566..16759b9a4 100644
--- a/fluxer_app/src/features/i18n/locales/en-GB/messages.po
+++ b/fluxer_app/src/features/i18n/locales/en-GB/messages.po
@@ -19,6 +19,11 @@ msgstr ""
msgid "... turn dense mode on. Nice!"
msgstr "... turn dense mode on. Nice!"
+#. Error at the bottom of the setup wizard branding step when an uploaded image could not be loaded from the server. label is the name of the image field, such as Sign-in background.
+#: src/features/app/components/setup/SetupBrandingStep.tsx
+msgid "\"{label}\" was saved but could not be loaded back."
+msgstr "\"{label}\" was saved but could not be loaded back."
+
#. Button or menu action label in the channel and chat user message. Keep it concise.
#. Suffix after the message text in the forward modal preview when the forwarded message was edited.
#: src/features/channel/components/MessageAttachments.tsx
@@ -36435,6 +36440,11 @@ msgstr "This group isn't marked for mature content. The group owner can turn on
msgid "This handoff code has expired. Generate a new one to continue."
msgstr "This handoff code has expired. Generate a new one to continue."
+#. Error on a branding image field in the setup wizard when the image was uploaded but loading it from the server failed. "Continue" is the label of the button that saves the step.
+#: src/features/app/components/setup/SetupBrandingAssetField.tsx
+msgid "This image could not be loaded after saving. Press \"Continue\" to try again, or choose a different file."
+msgstr "This image could not be loaded after saving. Press \"Continue\" to try again, or choose a different file."
+
#. Error modal body shown when an animated image fails to decode during cropping.
#: src/features/messaging/components/modals/ImageCropModal.tsx
msgid "This image couldn't be read. It may be damaged."
diff --git a/fluxer_app/src/features/i18n/locales/en-US/messages.po b/fluxer_app/src/features/i18n/locales/en-US/messages.po
index 5cb696e35..f37d412fb 100644
--- a/fluxer_app/src/features/i18n/locales/en-US/messages.po
+++ b/fluxer_app/src/features/i18n/locales/en-US/messages.po
@@ -19,6 +19,11 @@ msgstr ""
msgid "... turn dense mode on. Nice!"
msgstr "... turn dense mode on. Nice!"
+#. Error at the bottom of the setup wizard branding step when an uploaded image could not be loaded from the server. label is the name of the image field, such as Sign-in background.
+#: src/features/app/components/setup/SetupBrandingStep.tsx
+msgid "\"{label}\" was saved but could not be loaded back."
+msgstr "\"{label}\" was saved but could not be loaded back."
+
#. Button or menu action label in the channel and chat user message. Keep it concise.
#. Suffix after the message text in the forward modal preview when the forwarded message was edited.
#: src/features/channel/components/MessageAttachments.tsx
@@ -36435,6 +36440,11 @@ msgstr "This group is not marked for mature content. The group owner can turn on
msgid "This handoff code has expired. Generate a new one to continue."
msgstr "This handoff code has expired. Generate a new one to continue."
+#. Error on a branding image field in the setup wizard when the image was uploaded but loading it from the server failed. "Continue" is the label of the button that saves the step.
+#: src/features/app/components/setup/SetupBrandingAssetField.tsx
+msgid "This image could not be loaded after saving. Press \"Continue\" to try again, or choose a different file."
+msgstr "This image could not be loaded after saving. Press \"Continue\" to try again, or choose a different file."
+
#. Error modal body shown when an animated image fails to decode during cropping.
#: src/features/messaging/components/modals/ImageCropModal.tsx
msgid "This image couldn't be read. It may be damaged."
diff --git a/fluxer_app/src/features/i18n/locales/es-419/messages.po b/fluxer_app/src/features/i18n/locales/es-419/messages.po
index f9292f4b0..33cab1753 100644
--- a/fluxer_app/src/features/i18n/locales/es-419/messages.po
+++ b/fluxer_app/src/features/i18n/locales/es-419/messages.po
@@ -19,6 +19,11 @@ msgstr ""
msgid "... turn dense mode on. Nice!"
msgstr "... actives el modo denso. ¡Genial!"
+#. Error at the bottom of the setup wizard branding step when an uploaded image could not be loaded from the server. label is the name of the image field, such as Sign-in background.
+#: src/features/app/components/setup/SetupBrandingStep.tsx
+msgid "\"{label}\" was saved but could not be loaded back."
+msgstr "\"{label}\" se guardó pero no se pudo volver a cargar."
+
#. Button or menu action label in the channel and chat user message. Keep it concise.
#. Suffix after the message text in the forward modal preview when the forwarded message was edited.
#: src/features/channel/components/MessageAttachments.tsx
@@ -36435,6 +36440,11 @@ msgstr "Este grupo no está marcado para contenido para adultos. El propietario
msgid "This handoff code has expired. Generate a new one to continue."
msgstr "Este código de transferencia ha expirado. Genera uno nuevo para continuar."
+#. Error on a branding image field in the setup wizard when the image was uploaded but loading it from the server failed. "Continue" is the label of the button that saves the step.
+#: src/features/app/components/setup/SetupBrandingAssetField.tsx
+msgid "This image could not be loaded after saving. Press \"Continue\" to try again, or choose a different file."
+msgstr "No se pudo cargar esta imagen después de guardar. Pulsa \"Continuar\" para intentar de nuevo o elige otro archivo."
+
#. Error modal body shown when an animated image fails to decode during cropping.
#: src/features/messaging/components/modals/ImageCropModal.tsx
msgid "This image couldn't be read. It may be damaged."
diff --git a/fluxer_app/src/features/i18n/locales/es-ES/messages.po b/fluxer_app/src/features/i18n/locales/es-ES/messages.po
index 1b27d58a2..43570e547 100644
--- a/fluxer_app/src/features/i18n/locales/es-ES/messages.po
+++ b/fluxer_app/src/features/i18n/locales/es-ES/messages.po
@@ -19,6 +19,11 @@ msgstr ""
msgid "... turn dense mode on. Nice!"
msgstr "... actives el modo denso. ¡Genial!"
+#. Error at the bottom of the setup wizard branding step when an uploaded image could not be loaded from the server. label is the name of the image field, such as Sign-in background.
+#: src/features/app/components/setup/SetupBrandingStep.tsx
+msgid "\"{label}\" was saved but could not be loaded back."
+msgstr "\"{label}\" se guardó pero no se pudo volver a cargar."
+
#. Button or menu action label in the channel and chat user message. Keep it concise.
#. Suffix after the message text in the forward modal preview when the forwarded message was edited.
#: src/features/channel/components/MessageAttachments.tsx
@@ -36435,6 +36440,11 @@ msgstr "Este grupo no está marcado para contenido para adultos. El propietario
msgid "This handoff code has expired. Generate a new one to continue."
msgstr "Este código de transferencia ha caducado. Genera uno nuevo para continuar."
+#. Error on a branding image field in the setup wizard when the image was uploaded but loading it from the server failed. "Continue" is the label of the button that saves the step.
+#: src/features/app/components/setup/SetupBrandingAssetField.tsx
+msgid "This image could not be loaded after saving. Press \"Continue\" to try again, or choose a different file."
+msgstr "No se pudo cargar esta imagen después de guardar. Pulsa \"Continuar\" para intentarlo de nuevo o elige otro archivo."
+
#. Error modal body shown when an animated image fails to decode during cropping.
#: src/features/messaging/components/modals/ImageCropModal.tsx
msgid "This image couldn't be read. It may be damaged."
diff --git a/fluxer_app/src/features/i18n/locales/fi/messages.po b/fluxer_app/src/features/i18n/locales/fi/messages.po
index 8b1e3f8f2..4281266a4 100644
--- a/fluxer_app/src/features/i18n/locales/fi/messages.po
+++ b/fluxer_app/src/features/i18n/locales/fi/messages.po
@@ -19,6 +19,11 @@ msgstr ""
msgid "... turn dense mode on. Nice!"
msgstr "...otat tiiviin tilan käyttöön. Hienoa!"
+#. Error at the bottom of the setup wizard branding step when an uploaded image could not be loaded from the server. label is the name of the image field, such as Sign-in background.
+#: src/features/app/components/setup/SetupBrandingStep.tsx
+msgid "\"{label}\" was saved but could not be loaded back."
+msgstr "\"{label}\" tallennettiin, mutta sitä ei voitu ladata takaisin."
+
#. Button or menu action label in the channel and chat user message. Keep it concise.
#. Suffix after the message text in the forward modal preview when the forwarded message was edited.
#: src/features/channel/components/MessageAttachments.tsx
@@ -36435,6 +36440,11 @@ msgstr "Tätä ryhmää ei ole merkitty kypsälle sisällölle. Ryhmän omistaja
msgid "This handoff code has expired. Generate a new one to continue."
msgstr "Tämä siirtokoodi on vanhentunut. Luo uusi jatkaaksesi."
+#. Error on a branding image field in the setup wizard when the image was uploaded but loading it from the server failed. "Continue" is the label of the button that saves the step.
+#: src/features/app/components/setup/SetupBrandingAssetField.tsx
+msgid "This image could not be loaded after saving. Press \"Continue\" to try again, or choose a different file."
+msgstr "Tätä kuvaa ei voitu ladata tallennuksen jälkeen. Paina \"Jatka\" yrittääksesi uudelleen tai valitse toinen tiedosto."
+
#. Error modal body shown when an animated image fails to decode during cropping.
#: src/features/messaging/components/modals/ImageCropModal.tsx
msgid "This image couldn't be read. It may be damaged."
diff --git a/fluxer_app/src/features/i18n/locales/fr/messages.po b/fluxer_app/src/features/i18n/locales/fr/messages.po
index 43502df8d..e365e44be 100644
--- a/fluxer_app/src/features/i18n/locales/fr/messages.po
+++ b/fluxer_app/src/features/i18n/locales/fr/messages.po
@@ -19,6 +19,11 @@ msgstr ""
msgid "... turn dense mode on. Nice!"
msgstr "... activer le mode dense. Chouette !"
+#. Error at the bottom of the setup wizard branding step when an uploaded image could not be loaded from the server. label is the name of the image field, such as Sign-in background.
+#: src/features/app/components/setup/SetupBrandingStep.tsx
+msgid "\"{label}\" was saved but could not be loaded back."
+msgstr "« {label} » a été enregistré mais n’a pas pu être rechargé."
+
#. Button or menu action label in the channel and chat user message. Keep it concise.
#. Suffix after the message text in the forward modal preview when the forwarded message was edited.
#: src/features/channel/components/MessageAttachments.tsx
@@ -36435,6 +36440,11 @@ msgstr "Ce groupe n'est pas marqué comme contenu pour adultes. Le propriétaire
msgid "This handoff code has expired. Generate a new one to continue."
msgstr "Ce code de transfert a expiré. Générez-en un nouveau pour continuer."
+#. Error on a branding image field in the setup wizard when the image was uploaded but loading it from the server failed. "Continue" is the label of the button that saves the step.
+#: src/features/app/components/setup/SetupBrandingAssetField.tsx
+msgid "This image could not be loaded after saving. Press \"Continue\" to try again, or choose a different file."
+msgstr "Impossible de charger cette image après l’enregistrement. Appuyez sur « Continuer » pour réessayer ou choisissez un autre fichier."
+
#. Error modal body shown when an animated image fails to decode during cropping.
#: src/features/messaging/components/modals/ImageCropModal.tsx
msgid "This image couldn't be read. It may be damaged."
diff --git a/fluxer_app/src/features/i18n/locales/he/messages.po b/fluxer_app/src/features/i18n/locales/he/messages.po
index 7d1c5f6c7..ecedce8e2 100644
--- a/fluxer_app/src/features/i18n/locales/he/messages.po
+++ b/fluxer_app/src/features/i18n/locales/he/messages.po
@@ -19,6 +19,11 @@ msgstr ""
msgid "... turn dense mode on. Nice!"
msgstr "... להפעיל מצב צפוף. יפה!"
+#. Error at the bottom of the setup wizard branding step when an uploaded image could not be loaded from the server. label is the name of the image field, such as Sign-in background.
+#: src/features/app/components/setup/SetupBrandingStep.tsx
+msgid "\"{label}\" was saved but could not be loaded back."
+msgstr "‏\"{label}\" נשמר אך לא ניתן היה לטעון אותו מחדש."
+
#. Button or menu action label in the channel and chat user message. Keep it concise.
#. Suffix after the message text in the forward modal preview when the forwarded message was edited.
#: src/features/channel/components/MessageAttachments.tsx
@@ -36435,6 +36440,11 @@ msgstr "הקבוצה הזו אינה מסומנת כבעלת תוכן למבוג
msgid "This handoff code has expired. Generate a new one to continue."
msgstr "תוקף קוד ההעברה הזה פג. יש ליצור קוד חדש כדי להמשיך."
+#. Error on a branding image field in the setup wizard when the image was uploaded but loading it from the server failed. "Continue" is the label of the button that saves the step.
+#: src/features/app/components/setup/SetupBrandingAssetField.tsx
+msgid "This image could not be loaded after saving. Press \"Continue\" to try again, or choose a different file."
+msgstr "לא ניתן לטעון את התמונה לאחר השמירה. לחצו על \"המשך\" כדי לנסות שוב, או בחרו קובץ אחר."
+
#. Error modal body shown when an animated image fails to decode during cropping.
#: src/features/messaging/components/modals/ImageCropModal.tsx
msgid "This image couldn't be read. It may be damaged."
diff --git a/fluxer_app/src/features/i18n/locales/hi/messages.po b/fluxer_app/src/features/i18n/locales/hi/messages.po
index daf59161d..ac0674023 100644
--- a/fluxer_app/src/features/i18n/locales/hi/messages.po
+++ b/fluxer_app/src/features/i18n/locales/hi/messages.po
@@ -19,6 +19,11 @@ msgstr ""
msgid "... turn dense mode on. Nice!"
msgstr "... सघन मोड चालू करें। बढ़िया!"
+#. Error at the bottom of the setup wizard branding step when an uploaded image could not be loaded from the server. label is the name of the image field, such as Sign-in background.
+#: src/features/app/components/setup/SetupBrandingStep.tsx
+msgid "\"{label}\" was saved but could not be loaded back."
+msgstr "\"{label}\" सहेजा गया था लेकिन वापस लोड नहीं किया जा सका।"
+
#. Button or menu action label in the channel and chat user message. Keep it concise.
#. Suffix after the message text in the forward modal preview when the forwarded message was edited.
#: src/features/channel/components/MessageAttachments.tsx
@@ -36435,6 +36440,11 @@ msgstr "यह ग्रुप परिपक्व सामग्री क
msgid "This handoff code has expired. Generate a new one to continue."
msgstr "यह हैंडऑफ़ कोड समाप्त हो गया है। जारी रखने के लिए एक नया कोड जनरेट करें।"
+#. Error on a branding image field in the setup wizard when the image was uploaded but loading it from the server failed. "Continue" is the label of the button that saves the step.
+#: src/features/app/components/setup/SetupBrandingAssetField.tsx
+msgid "This image could not be loaded after saving. Press \"Continue\" to try again, or choose a different file."
+msgstr "यह छवि सहेजने के बाद लोड नहीं हो सकी। फिर से प्रयास करने के लिए \"जारी रखें\" दबाएँ, या कोई दूसरी फ़ाइल चुनें।"
+
#. Error modal body shown when an animated image fails to decode during cropping.
#: src/features/messaging/components/modals/ImageCropModal.tsx
msgid "This image couldn't be read. It may be damaged."
diff --git a/fluxer_app/src/features/i18n/locales/hr/messages.po b/fluxer_app/src/features/i18n/locales/hr/messages.po
index c02fd1238..83d3ba234 100644
--- a/fluxer_app/src/features/i18n/locales/hr/messages.po
+++ b/fluxer_app/src/features/i18n/locales/hr/messages.po
@@ -19,6 +19,11 @@ msgstr ""
msgid "... turn dense mode on. Nice!"
msgstr "... uključite zbijeni način rada. Super!"
+#. Error at the bottom of the setup wizard branding step when an uploaded image could not be loaded from the server. label is the name of the image field, such as Sign-in background.
+#: src/features/app/components/setup/SetupBrandingStep.tsx
+msgid "\"{label}\" was saved but could not be loaded back."
+msgstr "\"{label}\" je spremljen, ali se nije mogao ponovno učitati."
+
#. Button or menu action label in the channel and chat user message. Keep it concise.
#. Suffix after the message text in the forward modal preview when the forwarded message was edited.
#: src/features/channel/components/MessageAttachments.tsx
@@ -36435,6 +36440,11 @@ msgstr "Ova grupa nije označena kao sadržaj za odrasle. Vlasnik grupe može uk
msgid "This handoff code has expired. Generate a new one to continue."
msgstr "Ovaj je kod za prijenos istekao. Generirajte novi za nastavak."
+#. Error on a branding image field in the setup wizard when the image was uploaded but loading it from the server failed. "Continue" is the label of the button that saves the step.
+#: src/features/app/components/setup/SetupBrandingAssetField.tsx
+msgid "This image could not be loaded after saving. Press \"Continue\" to try again, or choose a different file."
+msgstr "Ova se slika nije mogla učitati nakon spremanja. Pritisni \"Nastavi\" za ponovni pokušaj ili odaberi drugu datoteku."
+
#. Error modal body shown when an animated image fails to decode during cropping.
#: src/features/messaging/components/modals/ImageCropModal.tsx
msgid "This image couldn't be read. It may be damaged."
diff --git a/fluxer_app/src/features/i18n/locales/hu/messages.po b/fluxer_app/src/features/i18n/locales/hu/messages.po
index 7a38c77e4..d30cef6e7 100644
--- a/fluxer_app/src/features/i18n/locales/hu/messages.po
+++ b/fluxer_app/src/features/i18n/locales/hu/messages.po
@@ -19,6 +19,11 @@ msgstr ""
msgid "... turn dense mode on. Nice!"
msgstr "... bekapcsold a sűrű módot. Szuper!"
+#. Error at the bottom of the setup wizard branding step when an uploaded image could not be loaded from the server. label is the name of the image field, such as Sign-in background.
+#: src/features/app/components/setup/SetupBrandingStep.tsx
+msgid "\"{label}\" was saved but could not be loaded back."
+msgstr "A(z) \"{label}\" mentve lett, de nem sikerült visszatölteni."
+
#. Button or menu action label in the channel and chat user message. Keep it concise.
#. Suffix after the message text in the forward modal preview when the forwarded message was edited.
#: src/features/channel/components/MessageAttachments.tsx
@@ -36435,6 +36440,11 @@ msgstr "Ez a csoport nem jelölt a felnőtt tartalomra. A csoport tulajdonosa be
msgid "This handoff code has expired. Generate a new one to continue."
msgstr "Ez az átadási kód lejárt. A folytatáshoz hozz létre újat."
+#. Error on a branding image field in the setup wizard when the image was uploaded but loading it from the server failed. "Continue" is the label of the button that saves the step.
+#: src/features/app/components/setup/SetupBrandingAssetField.tsx
+msgid "This image could not be loaded after saving. Press \"Continue\" to try again, or choose a different file."
+msgstr "A kép mentés után nem tölthető be. Próbáld újra a „Folytatás” gombbal, vagy válassz másik fájlt."
+
#. Error modal body shown when an animated image fails to decode during cropping.
#: src/features/messaging/components/modals/ImageCropModal.tsx
msgid "This image couldn't be read. It may be damaged."
diff --git a/fluxer_app/src/features/i18n/locales/id/messages.po b/fluxer_app/src/features/i18n/locales/id/messages.po
index a96fb4e85..abfc5d51d 100644
--- a/fluxer_app/src/features/i18n/locales/id/messages.po
+++ b/fluxer_app/src/features/i18n/locales/id/messages.po
@@ -19,6 +19,11 @@ msgstr ""
msgid "... turn dense mode on. Nice!"
msgstr "... nyalakan mode rapat. Mantap!"
+#. Error at the bottom of the setup wizard branding step when an uploaded image could not be loaded from the server. label is the name of the image field, such as Sign-in background.
+#: src/features/app/components/setup/SetupBrandingStep.tsx
+msgid "\"{label}\" was saved but could not be loaded back."
+msgstr "\"{label}\" telah disimpan tetapi tidak dapat dimuat kembali."
+
#. Button or menu action label in the channel and chat user message. Keep it concise.
#. Suffix after the message text in the forward modal preview when the forwarded message was edited.
#: src/features/channel/components/MessageAttachments.tsx
@@ -36435,6 +36440,11 @@ msgstr "Grup ini tidak ditandai untuk konten dewasa. Pemilik grup dapat mengakti
msgid "This handoff code has expired. Generate a new one to continue."
msgstr "Kode serah terima ini sudah kedaluwarsa. Buat yang baru untuk melanjutkan."
+#. Error on a branding image field in the setup wizard when the image was uploaded but loading it from the server failed. "Continue" is the label of the button that saves the step.
+#: src/features/app/components/setup/SetupBrandingAssetField.tsx
+msgid "This image could not be loaded after saving. Press \"Continue\" to try again, or choose a different file."
+msgstr "Gambar ini tidak dapat dimuat setelah disimpan. Tekan \"Lanjutkan\" untuk mencoba lagi, atau pilih file lain."
+
#. Error modal body shown when an animated image fails to decode during cropping.
#: src/features/messaging/components/modals/ImageCropModal.tsx
msgid "This image couldn't be read. It may be damaged."
diff --git a/fluxer_app/src/features/i18n/locales/it/messages.po b/fluxer_app/src/features/i18n/locales/it/messages.po
index 57058409d..01c420255 100644
--- a/fluxer_app/src/features/i18n/locales/it/messages.po
+++ b/fluxer_app/src/features/i18n/locales/it/messages.po
@@ -19,6 +19,11 @@ msgstr ""
msgid "... turn dense mode on. Nice!"
msgstr "... attiva la modalità compatta. Ottimo!"
+#. Error at the bottom of the setup wizard branding step when an uploaded image could not be loaded from the server. label is the name of the image field, such as Sign-in background.
+#: src/features/app/components/setup/SetupBrandingStep.tsx
+msgid "\"{label}\" was saved but could not be loaded back."
+msgstr "\"{label}\" è stato salvato ma non è stato possibile ricaricarlo."
+
#. Button or menu action label in the channel and chat user message. Keep it concise.
#. Suffix after the message text in the forward modal preview when the forwarded message was edited.
#: src/features/channel/components/MessageAttachments.tsx
@@ -36435,6 +36440,11 @@ msgstr "Questo gruppo non è contrassegnato per contenuti per adulti. Il proprie
msgid "This handoff code has expired. Generate a new one to continue."
msgstr "Questo codice di trasferimento è scaduto. Generane uno nuovo per continuare."
+#. Error on a branding image field in the setup wizard when the image was uploaded but loading it from the server failed. "Continue" is the label of the button that saves the step.
+#: src/features/app/components/setup/SetupBrandingAssetField.tsx
+msgid "This image could not be loaded after saving. Press \"Continue\" to try again, or choose a different file."
+msgstr "Impossibile caricare questa immagine dopo il salvataggio. Premi \"Continua\" per riprovare o scegli un altro file."
+
#. Error modal body shown when an animated image fails to decode during cropping.
#: src/features/messaging/components/modals/ImageCropModal.tsx
msgid "This image couldn't be read. It may be damaged."
diff --git a/fluxer_app/src/features/i18n/locales/ja/messages.po b/fluxer_app/src/features/i18n/locales/ja/messages.po
index abb44f68d..b0e7911bf 100644
--- a/fluxer_app/src/features/i18n/locales/ja/messages.po
+++ b/fluxer_app/src/features/i18n/locales/ja/messages.po
@@ -19,6 +19,11 @@ msgstr ""
msgid "... turn dense mode on. Nice!"
msgstr "…コンパクト表示をオンに。いいね!"
+#. Error at the bottom of the setup wizard branding step when an uploaded image could not be loaded from the server. label is the name of the image field, such as Sign-in background.
+#: src/features/app/components/setup/SetupBrandingStep.tsx
+msgid "\"{label}\" was saved but could not be loaded back."
+msgstr "「{label}」は保存されましたが、再読み込みできませんでした。"
+
#. Button or menu action label in the channel and chat user message. Keep it concise.
#. Suffix after the message text in the forward modal preview when the forwarded message was edited.
#: src/features/channel/components/MessageAttachments.tsx
@@ -36435,6 +36440,11 @@ msgstr "このグループは成人向けコンテンツの対象ではありま
msgid "This handoff code has expired. Generate a new one to continue."
msgstr "この引き継ぎコードは有効期限が切れました。新しいコードを生成して続行してください。"
+#. Error on a branding image field in the setup wizard when the image was uploaded but loading it from the server failed. "Continue" is the label of the button that saves the step.
+#: src/features/app/components/setup/SetupBrandingAssetField.tsx
+msgid "This image could not be loaded after saving. Press \"Continue\" to try again, or choose a different file."
+msgstr "この画像は保存後に読み込めませんでした。「続行」を押して再試行するか、別のファイルを選択してください。"
+
#. Error modal body shown when an animated image fails to decode during cropping.
#: src/features/messaging/components/modals/ImageCropModal.tsx
msgid "This image couldn't be read. It may be damaged."
diff --git a/fluxer_app/src/features/i18n/locales/ko/messages.po b/fluxer_app/src/features/i18n/locales/ko/messages.po
index 65003dde6..3187923c4 100644
--- a/fluxer_app/src/features/i18n/locales/ko/messages.po
+++ b/fluxer_app/src/features/i18n/locales/ko/messages.po
@@ -19,6 +19,11 @@ msgstr ""
msgid "... turn dense mode on. Nice!"
msgstr "... 좁게 모드를 켜 보세요. 좋아요!"
+#. Error at the bottom of the setup wizard branding step when an uploaded image could not be loaded from the server. label is the name of the image field, such as Sign-in background.
+#: src/features/app/components/setup/SetupBrandingStep.tsx
+msgid "\"{label}\" was saved but could not be loaded back."
+msgstr "\"{label}\"이(가) 저장되었지만 다시 불러올 수 없습니다."
+
#. Button or menu action label in the channel and chat user message. Keep it concise.
#. Suffix after the message text in the forward modal preview when the forwarded message was edited.
#: src/features/channel/components/MessageAttachments.tsx
@@ -36435,6 +36440,11 @@ msgstr "이 그룹은 성인 콘텐츠용으로 표시되지 않았습니다.
msgid "This handoff code has expired. Generate a new one to continue."
msgstr "이 핸드오프 코드가 만료되었습니다. 계속하려면 새 코드를 생성하세요."
+#. Error on a branding image field in the setup wizard when the image was uploaded but loading it from the server failed. "Continue" is the label of the button that saves the step.
+#: src/features/app/components/setup/SetupBrandingAssetField.tsx
+msgid "This image could not be loaded after saving. Press \"Continue\" to try again, or choose a different file."
+msgstr "이 이미지는 저장 후 불러올 수 없습니다. \"계속\"을 눌러 다시 시도하거나 다른 파일을 선택하세요."
+
#. Error modal body shown when an animated image fails to decode during cropping.
#: src/features/messaging/components/modals/ImageCropModal.tsx
msgid "This image couldn't be read. It may be damaged."
diff --git a/fluxer_app/src/features/i18n/locales/lt/messages.po b/fluxer_app/src/features/i18n/locales/lt/messages.po
index df018401d..d92f83135 100644
--- a/fluxer_app/src/features/i18n/locales/lt/messages.po
+++ b/fluxer_app/src/features/i18n/locales/lt/messages.po
@@ -19,6 +19,11 @@ msgstr ""
msgid "... turn dense mode on. Nice!"
msgstr "... įjungsite tankųjį režimą. Puiku!"
+#. Error at the bottom of the setup wizard branding step when an uploaded image could not be loaded from the server. label is the name of the image field, such as Sign-in background.
+#: src/features/app/components/setup/SetupBrandingStep.tsx
+msgid "\"{label}\" was saved but could not be loaded back."
+msgstr "„{label}“ buvo išsaugota, bet nepavyko įkelti atgal."
+
#. Button or menu action label in the channel and chat user message. Keep it concise.
#. Suffix after the message text in the forward modal preview when the forwarded message was edited.
#: src/features/channel/components/MessageAttachments.tsx
@@ -36436,6 +36441,11 @@ msgstr "Ši grupė nepažymėta kaip turinio suaugusiems. Grupės savininkas gal
msgid "This handoff code has expired. Generate a new one to continue."
msgstr "Šis perdavimo kodas nebegalioja. Norėdami tęsti, sugeneruokite naują."
+#. Error on a branding image field in the setup wizard when the image was uploaded but loading it from the server failed. "Continue" is the label of the button that saves the step.
+#: src/features/app/components/setup/SetupBrandingAssetField.tsx
+msgid "This image could not be loaded after saving. Press \"Continue\" to try again, or choose a different file."
+msgstr "Nepavyko įkelti šio paveikslėlio po išsaugojimo. Paspauskite „Tęsti“, kad bandytumėte dar kartą, arba pasirinkite kitą failą."
+
#. Error modal body shown when an animated image fails to decode during cropping.
#: src/features/messaging/components/modals/ImageCropModal.tsx
msgid "This image couldn't be read. It may be damaged."
diff --git a/fluxer_app/src/features/i18n/locales/nl/messages.po b/fluxer_app/src/features/i18n/locales/nl/messages.po
index bd95953bf..e85e2b457 100644
--- a/fluxer_app/src/features/i18n/locales/nl/messages.po
+++ b/fluxer_app/src/features/i18n/locales/nl/messages.po
@@ -19,6 +19,11 @@ msgstr ""
msgid "... turn dense mode on. Nice!"
msgstr "... compacte modus inschakelen. Mooi!"
+#. Error at the bottom of the setup wizard branding step when an uploaded image could not be loaded from the server. label is the name of the image field, such as Sign-in background.
+#: src/features/app/components/setup/SetupBrandingStep.tsx
+msgid "\"{label}\" was saved but could not be loaded back."
+msgstr "\"{label}\" is opgeslagen, maar kon niet opnieuw worden geladen."
+
#. Button or menu action label in the channel and chat user message. Keep it concise.
#. Suffix after the message text in the forward modal preview when the forwarded message was edited.
#: src/features/channel/components/MessageAttachments.tsx
@@ -36435,6 +36440,11 @@ msgstr "Deze groep is niet gemarkeerd voor volwassen inhoud. De groepeigenaar ka
msgid "This handoff code has expired. Generate a new one to continue."
msgstr "Deze overdrachtscode is verlopen. Genereer een nieuwe om verder te gaan."
+#. Error on a branding image field in the setup wizard when the image was uploaded but loading it from the server failed. "Continue" is the label of the button that saves the step.
+#: src/features/app/components/setup/SetupBrandingAssetField.tsx
+msgid "This image could not be loaded after saving. Press \"Continue\" to try again, or choose a different file."
+msgstr "Deze afbeelding kon niet worden geladen na het opslaan. Druk op \"Doorgaan\" om het opnieuw te proberen, of kies een ander bestand."
+
#. Error modal body shown when an animated image fails to decode during cropping.
#: src/features/messaging/components/modals/ImageCropModal.tsx
msgid "This image couldn't be read. It may be damaged."
diff --git a/fluxer_app/src/features/i18n/locales/no/messages.po b/fluxer_app/src/features/i18n/locales/no/messages.po
index ca3ac3f97..3f8f6761c 100644
--- a/fluxer_app/src/features/i18n/locales/no/messages.po
+++ b/fluxer_app/src/features/i18n/locales/no/messages.po
@@ -19,6 +19,11 @@ msgstr ""
msgid "... turn dense mode on. Nice!"
msgstr "... slå på kompakt modus. Bra!"
+#. Error at the bottom of the setup wizard branding step when an uploaded image could not be loaded from the server. label is the name of the image field, such as Sign-in background.
+#: src/features/app/components/setup/SetupBrandingStep.tsx
+msgid "\"{label}\" was saved but could not be loaded back."
+msgstr "\"{label}\" ble lagret, men kunne ikke lastes inn igjen."
+
#. Button or menu action label in the channel and chat user message. Keep it concise.
#. Suffix after the message text in the forward modal preview when the forwarded message was edited.
#: src/features/channel/components/MessageAttachments.tsx
@@ -36435,6 +36440,11 @@ msgstr "Denne gruppen er ikke merket for modent innhold. Gruppeeieren kan slå p
msgid "This handoff code has expired. Generate a new one to continue."
msgstr "Denne overføringskoden har utløpt. Generer en ny for å fortsette."
+#. Error on a branding image field in the setup wizard when the image was uploaded but loading it from the server failed. "Continue" is the label of the button that saves the step.
+#: src/features/app/components/setup/SetupBrandingAssetField.tsx
+msgid "This image could not be loaded after saving. Press \"Continue\" to try again, or choose a different file."
+msgstr "Dette bildet kunne ikke lastes inn etter lagring. Trykk på «Fortsett» for å prøve igjen, eller velg en annen fil."
+
#. Error modal body shown when an animated image fails to decode during cropping.
#: src/features/messaging/components/modals/ImageCropModal.tsx
msgid "This image couldn't be read. It may be damaged."
diff --git a/fluxer_app/src/features/i18n/locales/pl/messages.po b/fluxer_app/src/features/i18n/locales/pl/messages.po
index 3d8cd5235..1c14a2831 100644
--- a/fluxer_app/src/features/i18n/locales/pl/messages.po
+++ b/fluxer_app/src/features/i18n/locales/pl/messages.po
@@ -19,6 +19,11 @@ msgstr ""
msgid "... turn dense mode on. Nice!"
msgstr "... włącz tryb zwarty. Super!"
+#. Error at the bottom of the setup wizard branding step when an uploaded image could not be loaded from the server. label is the name of the image field, such as Sign-in background.
+#: src/features/app/components/setup/SetupBrandingStep.tsx
+msgid "\"{label}\" was saved but could not be loaded back."
+msgstr "„{label}” został zapisany, ale nie udało się go ponownie wczytać."
+
#. Button or menu action label in the channel and chat user message. Keep it concise.
#. Suffix after the message text in the forward modal preview when the forwarded message was edited.
#: src/features/channel/components/MessageAttachments.tsx
@@ -36435,6 +36440,11 @@ msgstr "Ta grupa nie jest oznaczona jako zawierająca treści dla dorosłych. W
msgid "This handoff code has expired. Generate a new one to continue."
msgstr "Ten kod przekazania wygasł. Wygeneruj nowy, aby kontynuować."
+#. Error on a branding image field in the setup wizard when the image was uploaded but loading it from the server failed. "Continue" is the label of the button that saves the step.
+#: src/features/app/components/setup/SetupBrandingAssetField.tsx
+msgid "This image could not be loaded after saving. Press \"Continue\" to try again, or choose a different file."
+msgstr "Nie udało się załadować tego obrazu po zapisaniu. Naciśnij „Kontynuuj”, aby spróbować ponownie lub wybierz inny plik."
+
#. Error modal body shown when an animated image fails to decode during cropping.
#: src/features/messaging/components/modals/ImageCropModal.tsx
msgid "This image couldn't be read. It may be damaged."
diff --git a/fluxer_app/src/features/i18n/locales/pt-BR/messages.po b/fluxer_app/src/features/i18n/locales/pt-BR/messages.po
index ae45f738e..a3962f0fe 100644
--- a/fluxer_app/src/features/i18n/locales/pt-BR/messages.po
+++ b/fluxer_app/src/features/i18n/locales/pt-BR/messages.po
@@ -19,6 +19,11 @@ msgstr ""
msgid "... turn dense mode on. Nice!"
msgstr "... ativar o modo denso. Boa!"
+#. Error at the bottom of the setup wizard branding step when an uploaded image could not be loaded from the server. label is the name of the image field, such as Sign-in background.
+#: src/features/app/components/setup/SetupBrandingStep.tsx
+msgid "\"{label}\" was saved but could not be loaded back."
+msgstr "\"{label}\" foi salvo, mas não pôde ser carregado de volta."
+
#. Button or menu action label in the channel and chat user message. Keep it concise.
#. Suffix after the message text in the forward modal preview when the forwarded message was edited.
#: src/features/channel/components/MessageAttachments.tsx
@@ -36435,6 +36440,11 @@ msgstr "Este grupo não está marcado para conteúdo adulto. O proprietário do
msgid "This handoff code has expired. Generate a new one to continue."
msgstr "Este código de transferência expirou. Gere um novo para continuar."
+#. Error on a branding image field in the setup wizard when the image was uploaded but loading it from the server failed. "Continue" is the label of the button that saves the step.
+#: src/features/app/components/setup/SetupBrandingAssetField.tsx
+msgid "This image could not be loaded after saving. Press \"Continue\" to try again, or choose a different file."
+msgstr "Não foi possível carregar esta imagem após o salvamento. Pressione \"Continuar\" para tentar novamente ou escolha outro arquivo."
+
#. Error modal body shown when an animated image fails to decode during cropping.
#: src/features/messaging/components/modals/ImageCropModal.tsx
msgid "This image couldn't be read. It may be damaged."
diff --git a/fluxer_app/src/features/i18n/locales/ro/messages.po b/fluxer_app/src/features/i18n/locales/ro/messages.po
index c1249f774..4ee8ccff7 100644
--- a/fluxer_app/src/features/i18n/locales/ro/messages.po
+++ b/fluxer_app/src/features/i18n/locales/ro/messages.po
@@ -19,6 +19,11 @@ msgstr ""
msgid "... turn dense mode on. Nice!"
msgstr "... activezi modul dens. Super!"
+#. Error at the bottom of the setup wizard branding step when an uploaded image could not be loaded from the server. label is the name of the image field, such as Sign-in background.
+#: src/features/app/components/setup/SetupBrandingStep.tsx
+msgid "\"{label}\" was saved but could not be loaded back."
+msgstr "„{label}” a fost salvat, dar nu a putut fi încărcat înapoi."
+
#. Button or menu action label in the channel and chat user message. Keep it concise.
#. Suffix after the message text in the forward modal preview when the forwarded message was edited.
#: src/features/channel/components/MessageAttachments.tsx
@@ -36435,6 +36440,11 @@ msgstr "Acest grup nu este marcat pentru conținut pentru adulți. Proprietarul
msgid "This handoff code has expired. Generate a new one to continue."
msgstr "Acest cod de transfer a expirat. Generează unul nou pentru a continua."
+#. Error on a branding image field in the setup wizard when the image was uploaded but loading it from the server failed. "Continue" is the label of the button that saves the step.
+#: src/features/app/components/setup/SetupBrandingAssetField.tsx
+msgid "This image could not be loaded after saving. Press \"Continue\" to try again, or choose a different file."
+msgstr "Imaginea nu a putut fi încărcată după salvare. Apasă „Continuă” pentru a încerca din nou sau alege un alt fișier."
+
#. Error modal body shown when an animated image fails to decode during cropping.
#: src/features/messaging/components/modals/ImageCropModal.tsx
msgid "This image couldn't be read. It may be damaged."
diff --git a/fluxer_app/src/features/i18n/locales/ru/messages.po b/fluxer_app/src/features/i18n/locales/ru/messages.po
index be29bc0ab..6201bb4c7 100644
--- a/fluxer_app/src/features/i18n/locales/ru/messages.po
+++ b/fluxer_app/src/features/i18n/locales/ru/messages.po
@@ -19,6 +19,11 @@ msgstr ""
msgid "... turn dense mode on. Nice!"
msgstr "...включите плотный режим. Отлично!"
+#. Error at the bottom of the setup wizard branding step when an uploaded image could not be loaded from the server. label is the name of the image field, such as Sign-in background.
+#: src/features/app/components/setup/SetupBrandingStep.tsx
+msgid "\"{label}\" was saved but could not be loaded back."
+msgstr "«{label}» был сохранён, но не удалось загрузить обратно."
+
#. Button or menu action label in the channel and chat user message. Keep it concise.
#. Suffix after the message text in the forward modal preview when the forwarded message was edited.
#: src/features/channel/components/MessageAttachments.tsx
@@ -36435,6 +36440,11 @@ msgstr "Этот чат не помечен как содержащий мате
msgid "This handoff code has expired. Generate a new one to continue."
msgstr "Срок действия этого кода истёк. Создайте новый, чтобы продолжить."
+#. Error on a branding image field in the setup wizard when the image was uploaded but loading it from the server failed. "Continue" is the label of the button that saves the step.
+#: src/features/app/components/setup/SetupBrandingAssetField.tsx
+msgid "This image could not be loaded after saving. Press \"Continue\" to try again, or choose a different file."
+msgstr "Не удалось загрузить это изображение после сохранения. Нажмите «Продолжить», чтобы попробовать снова, или выберите другой файл."
+
#. Error modal body shown when an animated image fails to decode during cropping.
#: src/features/messaging/components/modals/ImageCropModal.tsx
msgid "This image couldn't be read. It may be damaged."
diff --git a/fluxer_app/src/features/i18n/locales/sv-SE/messages.po b/fluxer_app/src/features/i18n/locales/sv-SE/messages.po
index 98df45d00..917d217ff 100644
--- a/fluxer_app/src/features/i18n/locales/sv-SE/messages.po
+++ b/fluxer_app/src/features/i18n/locales/sv-SE/messages.po
@@ -19,6 +19,11 @@ msgstr ""
msgid "... turn dense mode on. Nice!"
msgstr "... aktivera kompakt läge. Snyggt!"
+#. Error at the bottom of the setup wizard branding step when an uploaded image could not be loaded from the server. label is the name of the image field, such as Sign-in background.
+#: src/features/app/components/setup/SetupBrandingStep.tsx
+msgid "\"{label}\" was saved but could not be loaded back."
+msgstr "\"{label}\" sparades men kunde inte laddas in igen."
+
#. Button or menu action label in the channel and chat user message. Keep it concise.
#. Suffix after the message text in the forward modal preview when the forwarded message was edited.
#: src/features/channel/components/MessageAttachments.tsx
@@ -36435,6 +36440,11 @@ msgstr "Den här gruppen är inte markerad för moget innehåll. Gruppägaren ka
msgid "This handoff code has expired. Generate a new one to continue."
msgstr "Den här överlämningskoden har gått ut. Skapa en ny för att fortsätta."
+#. Error on a branding image field in the setup wizard when the image was uploaded but loading it from the server failed. "Continue" is the label of the button that saves the step.
+#: src/features/app/components/setup/SetupBrandingAssetField.tsx
+msgid "This image could not be loaded after saving. Press \"Continue\" to try again, or choose a different file."
+msgstr "Den här bilden kunde inte laddas efter att den sparats. Tryck på \"Fortsätt\" för att försöka igen, eller välj en annan fil."
+
#. Error modal body shown when an animated image fails to decode during cropping.
#: src/features/messaging/components/modals/ImageCropModal.tsx
msgid "This image couldn't be read. It may be damaged."
diff --git a/fluxer_app/src/features/i18n/locales/th/messages.po b/fluxer_app/src/features/i18n/locales/th/messages.po
index d11ef1554..bf93b3f9d 100644
--- a/fluxer_app/src/features/i18n/locales/th/messages.po
+++ b/fluxer_app/src/features/i18n/locales/th/messages.po
@@ -19,6 +19,11 @@ msgstr ""
msgid "... turn dense mode on. Nice!"
msgstr "... เปิดโหมดกระชับแล้ว เยี่ยมเลย!"
+#. Error at the bottom of the setup wizard branding step when an uploaded image could not be loaded from the server. label is the name of the image field, such as Sign-in background.
+#: src/features/app/components/setup/SetupBrandingStep.tsx
+msgid "\"{label}\" was saved but could not be loaded back."
+msgstr "\"{label}\" ถูกบันทึกแล้วแต่ไม่สามารถโหลดกลับมาได้"
+
#. Button or menu action label in the channel and chat user message. Keep it concise.
#. Suffix after the message text in the forward modal preview when the forwarded message was edited.
#: src/features/channel/components/MessageAttachments.tsx
@@ -36435,6 +36440,11 @@ msgstr "กลุ่มนี้ไม่ได้ตั้งค่าสำห
msgid "This handoff code has expired. Generate a new one to continue."
msgstr "รหัสส่งต่อนี้หมดอายุแล้ว สร้างรหัสใหม่เพื่อดำเนินการต่อ"
+#. Error on a branding image field in the setup wizard when the image was uploaded but loading it from the server failed. "Continue" is the label of the button that saves the step.
+#: src/features/app/components/setup/SetupBrandingAssetField.tsx
+msgid "This image could not be loaded after saving. Press \"Continue\" to try again, or choose a different file."
+msgstr "ไม่สามารถโหลดรูปภาพนี้หลังจากบันทึกได้ กด \"ดำเนินการต่อ\" เพื่อลองใหม่ หรือเลือกไฟล์อื่น"
+
#. Error modal body shown when an animated image fails to decode during cropping.
#: src/features/messaging/components/modals/ImageCropModal.tsx
msgid "This image couldn't be read. It may be damaged."
diff --git a/fluxer_app/src/features/i18n/locales/tr/messages.po b/fluxer_app/src/features/i18n/locales/tr/messages.po
index d59bf2c02..031b7c4bb 100644
--- a/fluxer_app/src/features/i18n/locales/tr/messages.po
+++ b/fluxer_app/src/features/i18n/locales/tr/messages.po
@@ -19,6 +19,11 @@ msgstr ""
msgid "... turn dense mode on. Nice!"
msgstr "... yoğun modu açın. Harika!"
+#. Error at the bottom of the setup wizard branding step when an uploaded image could not be loaded from the server. label is the name of the image field, such as Sign-in background.
+#: src/features/app/components/setup/SetupBrandingStep.tsx
+msgid "\"{label}\" was saved but could not be loaded back."
+msgstr "\"{label}\" kaydedildi ancak tekrar yüklenemedi."
+
#. Button or menu action label in the channel and chat user message. Keep it concise.
#. Suffix after the message text in the forward modal preview when the forwarded message was edited.
#: src/features/channel/components/MessageAttachments.tsx
@@ -36435,6 +36440,11 @@ msgstr "Bu grup, yetişkinlere yönelik içerik için işaretlenmemiş. Gruptaki
msgid "This handoff code has expired. Generate a new one to continue."
msgstr "Bu aktarım kodunun süresi doldu. Devam etmek için yeni bir tane oluşturun."
+#. Error on a branding image field in the setup wizard when the image was uploaded but loading it from the server failed. "Continue" is the label of the button that saves the step.
+#: src/features/app/components/setup/SetupBrandingAssetField.tsx
+msgid "This image could not be loaded after saving. Press \"Continue\" to try again, or choose a different file."
+msgstr "Bu görsel kaydedildikten sonra yüklenemedi. Tekrar denemek için \"Devam et\"e basın veya farklı bir dosya seçin."
+
#. Error modal body shown when an animated image fails to decode during cropping.
#: src/features/messaging/components/modals/ImageCropModal.tsx
msgid "This image couldn't be read. It may be damaged."
diff --git a/fluxer_app/src/features/i18n/locales/uk/messages.po b/fluxer_app/src/features/i18n/locales/uk/messages.po
index be05d79df..e05c040b3 100644
--- a/fluxer_app/src/features/i18n/locales/uk/messages.po
+++ b/fluxer_app/src/features/i18n/locales/uk/messages.po
@@ -19,6 +19,11 @@ msgstr ""
msgid "... turn dense mode on. Nice!"
msgstr "...увімкнете щільний режим. Чудово!"
+#. Error at the bottom of the setup wizard branding step when an uploaded image could not be loaded from the server. label is the name of the image field, such as Sign-in background.
+#: src/features/app/components/setup/SetupBrandingStep.tsx
+msgid "\"{label}\" was saved but could not be loaded back."
+msgstr "«{label}» було збережено, але не вдалося завантажити назад."
+
#. Button or menu action label in the channel and chat user message. Keep it concise.
#. Suffix after the message text in the forward modal preview when the forwarded message was edited.
#: src/features/channel/components/MessageAttachments.tsx
@@ -36435,6 +36440,11 @@ msgstr "Ця група не позначена як така, що містит
msgid "This handoff code has expired. Generate a new one to continue."
msgstr "Термін дії цього коду передачі закінчився. Створіть новий, щоб продовжити."
+#. Error on a branding image field in the setup wizard when the image was uploaded but loading it from the server failed. "Continue" is the label of the button that saves the step.
+#: src/features/app/components/setup/SetupBrandingAssetField.tsx
+msgid "This image could not be loaded after saving. Press \"Continue\" to try again, or choose a different file."
+msgstr "Не вдалося завантажити це зображення після збереження. Натисніть «Продовжити», щоб спробувати ще раз, або виберіть інший файл."
+
#. Error modal body shown when an animated image fails to decode during cropping.
#: src/features/messaging/components/modals/ImageCropModal.tsx
msgid "This image couldn't be read. It may be damaged."
diff --git a/fluxer_app/src/features/i18n/locales/vi/messages.po b/fluxer_app/src/features/i18n/locales/vi/messages.po
index 760c383ad..3b89286fc 100644
--- a/fluxer_app/src/features/i18n/locales/vi/messages.po
+++ b/fluxer_app/src/features/i18n/locales/vi/messages.po
@@ -19,6 +19,11 @@ msgstr ""
msgid "... turn dense mode on. Nice!"
msgstr "... bật chế độ dày đặc. Tuyệt!"
+#. Error at the bottom of the setup wizard branding step when an uploaded image could not be loaded from the server. label is the name of the image field, such as Sign-in background.
+#: src/features/app/components/setup/SetupBrandingStep.tsx
+msgid "\"{label}\" was saved but could not be loaded back."
+msgstr "\"{label}\" đã được lưu nhưng không thể tải lại."
+
#. Button or menu action label in the channel and chat user message. Keep it concise.
#. Suffix after the message text in the forward modal preview when the forwarded message was edited.
#: src/features/channel/components/MessageAttachments.tsx
@@ -36435,6 +36440,11 @@ msgstr "Nhóm này không được đánh dấu là có nội dung nhạy cảm.
msgid "This handoff code has expired. Generate a new one to continue."
msgstr "Mã chuyển giao này đã hết hạn. Tạo mã mới để tiếp tục."
+#. Error on a branding image field in the setup wizard when the image was uploaded but loading it from the server failed. "Continue" is the label of the button that saves the step.
+#: src/features/app/components/setup/SetupBrandingAssetField.tsx
+msgid "This image could not be loaded after saving. Press \"Continue\" to try again, or choose a different file."
+msgstr "Không thể tải hình ảnh này sau khi lưu. Nhấn \"Tiếp tục\" để thử lại hoặc chọn tệp khác."
+
#. Error modal body shown when an animated image fails to decode during cropping.
#: src/features/messaging/components/modals/ImageCropModal.tsx
msgid "This image couldn't be read. It may be damaged."
diff --git a/fluxer_app/src/features/i18n/locales/zh-CN/messages.po b/fluxer_app/src/features/i18n/locales/zh-CN/messages.po
index 0ace1900b..941f3a4f6 100644
--- a/fluxer_app/src/features/i18n/locales/zh-CN/messages.po
+++ b/fluxer_app/src/features/i18n/locales/zh-CN/messages.po
@@ -19,6 +19,11 @@ msgstr ""
msgid "... turn dense mode on. Nice!"
msgstr "…开启紧凑模式。赞!"
+#. Error at the bottom of the setup wizard branding step when an uploaded image could not be loaded from the server. label is the name of the image field, such as Sign-in background.
+#: src/features/app/components/setup/SetupBrandingStep.tsx
+msgid "\"{label}\" was saved but could not be loaded back."
+msgstr "“{label}”已保存,但无法重新加载。"
+
#. Button or menu action label in the channel and chat user message. Keep it concise.
#. Suffix after the message text in the forward modal preview when the forwarded message was edited.
#: src/features/channel/components/MessageAttachments.tsx
@@ -36435,6 +36440,11 @@ msgstr "此群组未标记为包含不适宜内容。如果群组成员均年满
msgid "This handoff code has expired. Generate a new one to continue."
msgstr "此切换码已过期。请生成新切换码以继续。"
+#. Error on a branding image field in the setup wizard when the image was uploaded but loading it from the server failed. "Continue" is the label of the button that saves the step.
+#: src/features/app/components/setup/SetupBrandingAssetField.tsx
+msgid "This image could not be loaded after saving. Press \"Continue\" to try again, or choose a different file."
+msgstr "保存后无法加载此图片。点击“继续”重试,或选择其他文件。"
+
#. Error modal body shown when an animated image fails to decode during cropping.
#: src/features/messaging/components/modals/ImageCropModal.tsx
msgid "This image couldn't be read. It may be damaged."
diff --git a/fluxer_app/src/features/i18n/locales/zh-TW/messages.po b/fluxer_app/src/features/i18n/locales/zh-TW/messages.po
index 5a9641666..4d79433eb 100644
--- a/fluxer_app/src/features/i18n/locales/zh-TW/messages.po
+++ b/fluxer_app/src/features/i18n/locales/zh-TW/messages.po
@@ -19,6 +19,11 @@ msgstr ""
msgid "... turn dense mode on. Nice!"
msgstr "…開啟緊湊模式。讚喔!"
+#. Error at the bottom of the setup wizard branding step when an uploaded image could not be loaded from the server. label is the name of the image field, such as Sign-in background.
+#: src/features/app/components/setup/SetupBrandingStep.tsx
+msgid "\"{label}\" was saved but could not be loaded back."
+msgstr "「{label}」已儲存,但無法重新載入。"
+
#. Button or menu action label in the channel and chat user message. Keep it concise.
#. Suffix after the message text in the forward modal preview when the forwarded message was edited.
#: src/features/channel/components/MessageAttachments.tsx
@@ -36435,6 +36440,11 @@ msgstr "這個群組未標記為成人內容。如果群組內所有成員都年
msgid "This handoff code has expired. Generate a new one to continue."
msgstr "此交接碼已過期。請產生新的交接碼以繼續。"
+#. Error on a branding image field in the setup wizard when the image was uploaded but loading it from the server failed. "Continue" is the label of the button that saves the step.
+#: src/features/app/components/setup/SetupBrandingAssetField.tsx
+msgid "This image could not be loaded after saving. Press \"Continue\" to try again, or choose a different file."
+msgstr "儲存後無法載入此圖片。請按「繼續」重試,或選擇其他檔案。"
+
#. Error modal body shown when an animated image fails to decode during cropping.
#: src/features/messaging/components/modals/ImageCropModal.tsx
msgid "This image couldn't be read. It may be damaged."
diff --git a/fluxer_media_proxy/src/component_tests.rs b/fluxer_media_proxy/src/component_tests.rs
index e380f0669..7b7f30f9f 100644
--- a/fluxer_media_proxy/src/component_tests.rs
+++ b/fluxer_media_proxy/src/component_tests.rs
@@ -14,3 +14,38 @@ fn blocked_libvips_loaders_cannot_decode_untrusted_input() {
assert!(raw.is_null());
unsafe { native::fluxer_vips_error_clear() };
}
+
+#[test]
+fn full_size_wallpaper_fits_a_small_memory_budget_instead_of_failing() {
+ use crate::{
+ image_quality::ImageQuality,
+ image_transform::{AnimationMode, ImageOptions, ResizeMode},
+ media_process::{MediaLimits, NativeCost, image_transform_cost, transform_image},
+ metrics::transform::TransformMetrics,
+ mime,
+ output_format::OutputFormat,
+ test_fixtures::synthetic_png,
+ };
+ let budget = 240 << 20;
+ let limits = MediaLimits::default_from_config().with_native_memory_budget(budget);
+ let input = synthetic_png(3840, 2160);
+ let options = ImageOptions {
+ width: None,
+ height: None,
+ format: OutputFormat::WebP,
+ quality: ImageQuality::High,
+ animation: AnimationMode::Static,
+ effort_override: None,
+ resize_mode: ResizeMode::Fit,
+ deadline_ms: None,
+ };
+ let NativeCost::Bytes(cost) = image_transform_cost(&input, &options, &limits).unwrap() else {
+ panic!("a still image has a fixed cost");
+ };
+ assert!(cost <= budget);
+ let output = transform_image(&input, &options, &limits, &TransformMetrics::default()).unwrap();
+ let served = mime::sniff(&output.bytes);
+ assert_eq!("image/webp", served.mime);
+ assert!(served.width >= 2400 && served.width < 3840);
+ assert!((served.width * 9).abs_diff(served.height * 16) <= 16);
+}
diff --git a/fluxer_media_proxy/src/media_process/native_cost.rs b/fluxer_media_proxy/src/media_process/native_cost.rs
index 4abd6eef2..891183efe 100644
--- a/fluxer_media_proxy/src/media_process/native_cost.rs
+++ b/fluxer_media_proxy/src/media_process/native_cost.rs
@@ -48,7 +48,8 @@ pub fn image_transform_cost(
let sniffed_mime = mime::sniff(input).mime;
let dims = probe_image_dims(media_limits, input)?;
let source_pixels = dims.width as usize * dims.height as usize;
- let options = fit_jxl_output(input.len(), sniffed_mime, options, dims, media_limits);
+ let options =
+ fit_static_output_to_budget(input.len(), sniffed_mime, options, dims, media_limits);
let output_pixels = static_output_pixels(&options, dims);
let encode = encode_bytes_per_pixel(options.format, options.quality);
let pixel_cost = if options.is_animated() && dims.pages > 1 {
@@ -60,7 +61,7 @@ pub fn image_transform_cost(
Ok(NativeCost::Bytes(input.len().saturating_add(pixel_cost)))
}
-pub(super) fn fit_jxl_output(
+pub(super) fn fit_static_output_to_budget(
input_len: usize,
sniffed_mime: &str,
options: &ImageOptions,
@@ -68,7 +69,7 @@ pub(super) fn fit_jxl_output(
media_limits: &MediaLimits,
) -> ImageOptions {
let mut fitted = *options;
- if sniffed_mime != "image/jxl" || options.is_animated() {
+ if options.is_animated() {
return fitted;
}
let source_pixels = dims.width as usize * dims.height as usize;
diff --git a/fluxer_media_proxy/src/media_process/transform.rs b/fluxer_media_proxy/src/media_process/transform.rs
index d3bb8651c..023cb71c1 100644
--- a/fluxer_media_proxy/src/media_process/transform.rs
+++ b/fluxer_media_proxy/src/media_process/transform.rs
@@ -16,7 +16,7 @@ use super::loaded_image::{
static_output_pixels, validate_dimensions_u32, validate_jxl_decode_pixels,
validate_static_output_pixels, validate_vips_image,
};
-use super::native_cost::fit_jxl_output;
+use super::native_cost::fit_static_output_to_budget;
use super::native_runtime::{clear_vips_error, ensure_vips_init, last_vips_error};
use super::transform_plan::{
AutoQualitySource, output_is_sdr, resolve_auto_quality, should_transform_animated_webp_direct,
@@ -92,7 +92,8 @@ fn admitted_transform_options(
return Ok(*options);
}
let dims = probe_image_dims(media_limits, input)?;
- let options = &fit_jxl_output(input.len(), sniffed_mime, options, dims, media_limits);
+ let options =
+ &fit_static_output_to_budget(input.len(), sniffed_mime, options, dims, media_limits);
let source_pixels = dims.width as usize * dims.height as usize;
if source_pixels >= constants::LARGE_SOURCE_LOG_PIXELS {
tracing::info!(
diff --git a/fluxer_media_proxy/src/server/stored/mod.rs b/fluxer_media_proxy/src/server/stored/mod.rs
index d65ced803..13c2b87c1 100644
--- a/fluxer_media_proxy/src/server/stored/mod.rs
+++ b/fluxer_media_proxy/src/server/stored/mod.rs
@@ -226,15 +226,15 @@ struct AssetTransformFailure<'a> {
fn asset_transform_failure_response(failure: AssetTransformFailure<'_>) -> Response {
let stored_ct = failure.object.content_type.as_str();
+ let sniffed_ct = failure.sniffed_content_type;
let src_ct = if !stored_ct.starts_with("image/")
- && is_browser_displayable_image(failure.sniffed_content_type)
+ && (is_browser_displayable_image(sniffed_ct) || sniffed_ct == "image/avif")
{
- failure.sniffed_content_type
+ sniffed_ct
} else {
stored_ct
};
let src_is_displayable = src_ct.starts_with("image/")
- && src_ct != "image/avif"
&& src_ct != "image/heic"
&& src_ct != "image/heif"
&& failure.source_format != AssetExtension::Svg