Urgent.News

What's breaking now, across thousands of outlets.

Tech

dev.to re-encodes and crops your cover image, and I measured exactly where the crop lands

I had a cover image with a line of small text near the left edge. On the post page it looked right. In the feed card it was gone. Not clipped, not small, absent, and I could not reproduce it by resizing my browser. The image you see on dev.to is not the image you uploaded. It comes through a transform proxy, and the parameters in the proxy URL decide what happens to your pixels. There are two…

Dev.to re-encodes and crops your cover image, and a reporter measured the exact location of the cropping. The platform uses a transform proxy that applies different parameters depending on where the image appears. There are two parameter sets in play, behaving oppositely. The "cover" mode returns the exact box requested, while the "inline" mode preserves aspect ratio and fits the whole image inside the box.

The proxy returns WebP format, regardless of the source file. The dimensions of the returned WebP image vary, with a 1000x420 PNG yielding a 400x400 image in "cover" mode and a 400x168 image in "inline" mode. The reporter discovered that the exact dimensions and cropping behavior of the proxy are determined by the URL parameters, which cannot be controlled by the author.

The reporter found that generating covers at exactly 1000x420 and ensuring meaningful content stays away from the edges could mitigate the cropping issue. Inline images should be generated at 1600 wide for retina, with any height, and file size considerations should be set aside.

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

My writing linter can be defeated by writing more. I measured how much more.

I ran my writing checker over one of my own published posts twice: once on the whole file, once on just the body with the front matter removed. Same post. Same prose.

  • Writing linter scores unchanged when front matter removed
  • Density-based tests can be reduced by adding non-objective text
  • Separating set-based and density-based scores prevents padding

Self-hosting break-even: $23/month of SaaS, a $170 mini PC, about 9 months

Replacing $23/month in SaaS subscriptions (Google One 2TB + 1Password + Plex Pass) with a $170 mini PC drawing 15W idle breaks even in about 9 months.

  • Replacing $23/month SaaS with $170 mini PC yields 9-month break-even
  • Payback depends on what services are replaced, not on $10/month storage
  • Electricity costs and hardware choice significantly affect break-even timeline

How long do you keep a published claim provisional?

I retracted a benchmark this week. Two weeks ago I published a timing figure, described it as a fixed cost, and built an argument on it.

  • Author faces decision on retaining provisional claim validity.
  • Four instances of correcting published figures due to various issues.
  • Author suggests treating numbers as provisional with changelog.

Adding a NOT NULL Column to a Large PostgreSQL Table: Constant Default, Backfill or NOT VALID

Disclosure: I build Schemity , a desktop ERD tool - this post is from our blog and uses it for the examples. TL;DR: On PostgreSQL 11 and later, ADD COLUMN ...

  • Adding a NOT NULL column with constant default (e.g., NOW()) is fast in PostgreSQL 11+.
  • For per-row computed values, add column as nullable, backfill in batches, then set NOT NULL.
  • PostgreSQL 12+ allows NOT VALID constraint to skip full table scan during backfill.

More from Thursday 1 October →