Urgent.News

What's breaking now, across thousands of outlets.

More in Tech

The Test Data I Did Not Write

In July I was looking at our charging map and saw two pins where there should have been one. Same charging site, a few metres apart, two listings. I zoomed out and found another. Then another.

  • Two charging pins appeared where one should have existed.
  • Tests written with assumptions, not real data.
  • Code review emphasized for thorough verification.

Hitting a file-size window with canvas.toBlob: fitting passport photos into 54–240 KB

Government photo upload forms are strict about file size, and they are strict in both directions. The US DS-160 visa form wants a JPEG of at most 240 KB with a compression ratio no higher than 20:1.

  • US DS-160 visa form accepts JPEG up to 240 KB with 20:1 compression ratio
  • Binary search used to find optimal JPEG quality within 54–240 KB file size window
  • Aim for largest file fitting within byte window to maintain photo quality

More from Wednesday 30 September →