SShortSingh.
Back to feed

Browser image loop decodes, draws, encodes and saves photos one at a time, with per-step timings

0
·5 views

A developer reviewed a teammate's in-browser loop that converts a folder of product photos to JPEGs for an upload form, measuring each step with timers. The loop processes one photo at a time and releases the decoded bitmap after drawing it to a canvas, keeping memory low compared with decoding everything first, which had reached about 5,192 MB by photo 100. Tests on six valid photos plus two invalid files showed that corrupt images are caught at the decode step by a try/catch, so processing continues rather than stopping early. Measurements across two runs put decoding at roughly 24–29 ms per photo and encoding at 46–52 ms, with drawing and saving much faster. The author notes that the progress display should show each file's label, since files arrive in input order rather than sorted order.

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 localizes a Django app into seven languages, including RTL support

A solo developer translated a large Django application into English plus six other languages: Arabic, Chinese, Spanish, French, Russian, and Bengali. The write-up explains the motivation, which centers on making free project management learning content accessible to non-English speakers and expanding the site's indexable pages. The app's translations for the six non-English languages are AI-assisted drafts, and the app labels them as beta. The article describes handling interface strings with gettext while storing long-form lessons as per-language Markdown files with English fallback. It also covers technical hurdles such as right-to-left layout using CSS logical properties and the language-tag mismatch between zh-hans and zh.

0
ProgrammingDEV Community ·

Sloth Brief: a local model turns scattered notes into a short restart checklist

Sloth Brief is an open-source tool that condenses a set of accumulated text notes into a brief, source-linked action list. It runs the Qwen2.5-0.5B-Instruct model locally via Hugging Face Transformers, so no paid API or cloud upload of notes is needed. The model writes one concise summary per note, and Python assigns source numbers from the notes actually supplied, though the author warns that summaries still need checking against the originals. Input files are never edited, and the demo of two synthetic notes passes eight automated tests that cover limits and file handling but not model accuracy. The author notes that no productivity gains have been measured, and that the prototype was built with Codex assistance.

0
ProgrammingDEV Community ·

EU launches AI Act Service Desk offering multilingual expert answers for businesses

The European Commission has opened the AI Act Service Desk and a companion Single Information Platform to help companies understand how the EU AI Act affects them. Businesses can submit questions to experts working with the EU AI Office in any official EU language, after signing in with EU Login. The Service Desk handles specific inquiries, while the Single Information Platform offers self-service tools such as a Compliance Checker and an AI Act Explorer. The platform is currently available in English, French and German, with the rest of the EU languages expected in early 2026. The Commission suggests that companies prepare focused questions tied to particular AI systems and their roles to get the most useful guidance.