SShortSingh.
Back to feed

Safari silently returns PNG when WebP encoding is requested via canvas API

0
·1 views

A developer building a browser-based image converter discovered that Safari does not support WebP encoding through the HTML canvas API, despite being able to decode WebP since Safari 14. When a WebP is requested via canvas.toBlob(), Safari silently falls back to PNG without throwing an error or warning, as the HTML spec permits. This means users can unknowingly download a PNG file mislabeled with a .webp extension, which may cause failures in downstream systems. The only reliable fix is to explicitly check the returned blob's MIME type after the call. When canvas encoding cannot be trusted, developers must ship a WebAssembly-compiled codec like libwebp directly, which introduces its own set of build-tool challenges in environments like Vite.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Developer builds 5-band parametric EQ in MATLAB using biquad filters and RBJ coefficients

A software developer has documented the design of a five-band parametric equalizer built entirely in MATLAB, using cascaded biquad filters derived from RBJ cookbook coefficients. The project relies on the bilinear transform to map analog filter prototypes onto the digital z-plane, with frequency prewarping applied to ensure accurate center frequencies. The implementation covers peaking, low-pass, and high-pass filter types, and includes a live response curve, rolling spectrogram, and pole-zero visualization. Written as a single class definition, the project avoids MATLAB's App Designer and requires no additional toolboxes beyond base MATLAB. The author also provides an honest audit of where the implementation diverges from its own user interface, including measurable frequency warping near the Nyquist limit.

0
ProgrammingDEV Community ·

WanderJournal Lets Travelers Leave Digital Pages for Strangers Worldwide

A developer built WanderJournal, a digital travel journal platform, as a submission for the DEV Community Weekend Challenge themed around generosity. The app lets users contribute pages to shared journals organized around themes such as food memories, city discoveries, or everyday moments, with each page tied to a person and a place. Rather than a standard social feed, the experience is designed to feel like passing a physical journal to a stranger, complete with editorial typography and paper-like visuals. To address language barriers, the platform integrates Google AI translation, displaying translated text separately so original contributions remain intact. Built with React, Vite, and Supabase, the project is live on Vercel and its source code is publicly available on GitHub.

0
ProgrammingDEV Community ·

Why Every System Integration Needs a Named Failure Owner Before Go-Live

Most integration designs focus on the success path, leaving ambiguous failure states unassigned and unresolved. A timeout or partial response does not confirm whether a business action — such as an order being scheduled or stock allocated — actually completed. Engineers are advised to model each handoff as a series of distinct business states rather than a single boolean flag like 'synced'. Using stable idempotency keys tied to the intended action, not the network attempt, helps prevent duplicate effects during retries. Reconciliation processes and clearly separated error categories — transport failure, incomplete acceptance, and business rejection — should be built in before a system goes live.

0
ProgrammingDEV Community ·

Open Tab App Lets Customers Pool Spare Change to Help Others at Checkout

A developer has built a prototype called Open Tab that allows customers to contribute small amounts of spare change during checkout, which flow into a shared pool others can draw from without any application or explanation. The system rounds up a purchase to the nearest 50-cent mark, or adds €0.20 when the total already ends in .00 or .50, and always shows the contribution amount before payment is confirmed. The weekend prototype connects two fictional businesses, Café Sol and Bread & Butter Bakery, both feeding the same shared pool and activity ledger. Research cited from the Journal of Consumer Psychology suggests round-up donation prompts generate more favourable responses than flat donation requests, attributed to a lower perceived pain of giving. The project remains a proof-of-concept, and real-world viability would depend on merchant participation, checkout volume, and measured customer contribution rates.