SShortSingh.
Back to feed

Developer shares SVG method for drawing labelled overlays on user photos

0
·2 views

A developer working on a palm reading web app explains how to draw labelled overlays on user photos using SVG rather than canvas or a library. The approach has the backend return normalized coordinates between 0 and 1, which survive resizing and high-density screens better than pixel values. The SVG shares a positioned container with the image and uses a matching viewBox so the browser handles scaling without resize listeners. Smooth curves come from Catmull-Rom splines converted to Bezier paths, with a dark halo and bright stroke keeping lines visible on varied backgrounds. The article also covers greedy label placement to avoid overlaps and normalizing phone photo orientation before analysis.

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 ·

Reject Duplicate JSON Keys Before Validating a Record

A technical article explains why validating only the dictionary produced by a JSON decoder can miss repeated member names, since the duplicate may vanish during decoding. It recommends inspecting key-value pairs during decoding, using Python's object_pairs_hook to detect repeats at every nesting level. The article presents a teaching parser that enforces a 4,096-byte UTF-8 limit, requires a top-level object, rejects non-finite constants like NaN, and parses decimals as Decimal values. The example code was tested locally on Python 3.12 with six cases, using invented fixtures rather than production data. The author notes that this decoding check is separate from application-level schema and range validation, which should be tested independently.

0
ProgrammingDEV Community ·

Security, safety, robustness and privacy are distinct AI risk problems

Teams often lump all AI risks under a single label like security or safety, which makes it hard to tell whether a guardrail actually addresses them. The article argues these four concerns are related but distinct: security covers unauthorized actors violating confidentiality, integrity, availability or control, while safety concerns harm from normal operation, even without an attacker. Robustness asks whether behavior stays acceptable under noise, shifted data or ambiguity, and privacy asks whether personal information is collected, used or disclosed appropriately. Using a clinical summarization model as an example, it shows how one scenario can be a security attack, a robustness failure, or a privacy problem, each requiring different controls. The author recommends assigning separate owners, evidence and thresholds to each discipline within a shared risk register.

0
ProgrammingDEV Community ·

Shopify customer merge fails: what the customerMerge docs say about blockers and gaps

A developer guide explains how to diagnose failed Shopify customer merges by checking userErrors, Customer.mergeable, and the customers/merge webhook. It notes that Shopify's documentation lists hard blockers such as subscriptions, store credit, and company contacts, but does not map every error code to a blocker. The customerMerge mutation rules determining which customer survives are summarized, along with its asynchronous job behavior and required access scope. The Help Center's nine profile-level merge blockers and the CustomerMergeErrorFieldType enum's 11 values are compared, with the author flagging mismatches and noting that merges are irreversible.

0
ProgrammingDEV Community ·

Company adds WebMCP tools to its own website as a test of the emerging agent standard

A web development firm that builds WebMCP integrations for clients has added the proposed standard to its own service page. WebMCP lets a page register named tools that AI agents can call directly, instead of having to guess how to interact with buttons and forms. The firm's setup includes a read-only tool for retrieving its service packages, a read-only FAQ search tool, and a tool that pre-fills its audit request form without submitting it. The article notes that the API is still early, with Chrome testing it as an origin trial and Firefox and Safari not announcing support, and that it has changed in 2026. The firm advises starting with read-only lookup tools and never exposing admin functions or customer data through them.