Urgent.News

What's breaking now, across thousands of outlets.

Tech

Why PDF image extractors return the stored picture, not the one on the page

Every extractor I pointed at my test PDF gave me back a rotated picture unrotated and a half-hidden picture whole. After three years of codec work I took that as the correct answer, but I wanted to be able to say why. The file is one hand-written page with four lossless images. Each has four coloured corners and a big letter, so I can see which way it faces. A is hidden by a clip path, so the…

PDF image extractors return the stored picture, not the one on the page. After three years of codec work, the author wanted to understand why. The file is a single hand-written page containing four lossless images, each with distinct characteristics - A hidden by a clip path, B rotated 90° counter-clockwise, C mirrored, and D a 16-colour palette image with specific decoding rules.

The author tested various tools including pdfimages, PyMuPDF, the decoded bitmap from pdf.js, and ImgIng to extract the images. However, three tools - pdfimages, PyMuPDF and pdf.js - returned the stored pixels, the same SHA-256 hash, for A, B and C. D, on the other hand, returned the page's colours, applying /Decode and ignoring the clip and matrix.

Reading the source material suggests that the tools decode the object and stop where the page starts placing it. The author's hypothesis is that the extraction process depends on where the instruction lives - whether it's in the image's own dictionary or in the page's content stream. This finding has implications for how readers perceive PDF images, as the extracted image may not match the visible part on the page.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Parsing and Stripping EXIF Metadata Completely In-Browser with JavaScript ArrayBuffers

Every smartphone photo you take embeds precise metadata inside the file: GPS latitude and longitude, camera serial numbers, lens focal lengths, and timestamps.

  • ScanMetadata runs entirely in browser memory using ArrayBuffer and DataView
  • JPEG file composed of sequential binary segments with EXIF metadata in APP1 segment
  • LocateExifSegment function reads first 128KB to find EXIF segment start offset

A copyable MCP tool-cost check for CI, with passing and failing examples

A tool's description can shrink while its schema grows. A single token total can hide that regression. Here is a complete example that checks the total, descriptions and input schemas separately, then…

  • Tool cost regression detected by CI check
  • HISTOR tool lists verified for expected counts and digests
  • CI integration with baseline snapshot for ongoing monitoring

We collected 1,045 hours of sleep audio. Only 53 hours were usable for training.

We have 1,045 hours of overnight bedroom audio. For training a sleep-phase model, about 53 of those hours are usable. That ratio is the least glamorous number in this project and probably the most…

  • 1,045 hours of sleep audio collected for model training
  • Only 53 hours of audio deemed usable for training
  • Strict criteria resulted in 20:1 ratio of collected to usable data

PostgreSQL VACUUM Monitoring: Stop Table Bloat Before It Hurts

Originally published on kuryzhev.cloud Without PostgreSQL VACUUM monitoring, a busy table can degrade for weeks before anyone notices.

  • Table bloat silently degrades PostgreSQL performance
  • MVCC mechanism retains row versions, causing bloat
  • Proactive VACUUM monitoring and per-table tuning recommended

More from Sunday 25 October →