Skip to content
EN

GenAI, Exif Data, and the Code Behind Watermarking: How Devs Can Fight Real Estate Deepfakes

Correction, November 4, 2026: Clarified the July 16 NYC disclosure announcement and removed an unsupported compliance promise. Distinguished missing credentials, validation failures, and signer trust; replaced the Python example with a version-pinned inspection command; and removed the “Verified Real Photo” claim. The command is documentation-checked, not runtime-tested.

Hey everyone, Alex here. Welcome back to another edition of Coding with Alex on sysseder.com.

On July 16, 2026, New York City Mayor Zohran Mamdani announced the Rental Ripoff Report, including a recommendation to require disclosure when rental listings are altered with AI or other digital tools. The announcement described planned measures, not a blanket ban on AI images. This article uses that dated announcement as context; it does not establish which legal requirements were in force then or are in force today. NYC announcement

While this might sound like a purely legislative or municipal issue, as software engineers, web developers, and DevOps professionals, this is fundamentally a technical problem that lands squarely on our laps.

When a property-listing platform needs to disclose AI-altered images, what can its upload pipeline actually establish? How can we inspect provenance at scale while keeping uncertainty visible to users?

Today, we’re going to dive into the technical reality of GenAI image detection, metadata extraction, cryptographic watermarking, and how we can implement these verification pipelines in our own web applications.

The Technical Challenge: Why Simple "AI Detectors" Fail

When product managers hear about AI-image disclosure requirements, their immediate reaction is often: "Can't we just use an API to detect if an image is AI-generated?"

The short answer is: No, not reliably.

Heuristic-based AI detectors (which look for anomalies in pixel distribution, frequency domains, or structural patterns) are a game of cat-and-mouse. As generators like Stable Diffusion XL, Midjourney v6, and Flux.1 improve, the artifacts they leave behind shrink. Furthermore, running deep learning classification models on every single image upload in your pipeline is incredibly expensive, introduces high latency, and suffers from terrible false-positive rates (e.g., flagging a real photo taken in weird lighting as "AI-generated").

Instead of relying on fragile post-hoc detection, the industry is shifting toward provenance, metadata analysis, and cryptographic watermarking. Let's look at how we can implement a multi-layered verification strategy in our application backends.

Layer 1: Parsing Exif and Metadata (The Low-Hanging Fruit)

When generative AI engines output an image, they often write specific metadata tags into the file's Exif (Exchangeable Image File Format) data, or they omit standard camera hardware tags entirely.

For example, images generated directly via Adobe Fireplace, DALL-E 3 (via ChatGPT), or Midjourney often contain explicit creator tags or software markers. Let's write a Node.js utility using the exiftool-vendored library to inspect an uploaded image for tell-tale signs of AI generation.

Code Example: Analyzing Metadata in Node.js

import { exiftool } from "exiftool-vendored";

/**
 * Analyzes an image's metadata for signs of AI generation.
 * @param {string} filePath - Path to the uploaded image.
 * @returns {Promise<object>} - Verification report.
 */
async function inspectImageMetadata(filePath) {
  try {
    const tags = await exiftool.read(filePath);
    
    const indicators = {
      isAiSuspected: false,
      reasons: [],
      software: tags.Software || 'Unknown',
      cameraMake: tags.Make || 'Unknown',
    };

    // 1. Check for known AI generation software signatures
    const aiSoftwares = ['midjourney', 'stable diffusion', 'dall-e', 'firefly', 'novelai'];
    if (tags.Software) {
      const softwareLower = tags.Software.toLowerCase();
      if (aiSoftwares.some(ai => softwareLower.includes(ai))) {
        indicators.isAiSuspected = true;
        indicators.reasons.push(`Known AI software detected: ${tags.Software}`);
      }
    }

    // 2. Check for the absence of physical camera metadata (Heuristic)
    // Most real smartphones/DSLRs write Exif tags like FNumber, ISO, LensModel, or ExposureTime
    const hasCameraHardwareMetadata = !!(tags.FNumber || tags.ISO || tags.ExposureTime || tags.LensModel);
    
    // PNGs and web-optimized JPGs often strip this anyway, but in a real-estate context,
    // landlords uploading photos taken on an iPhone should almost always have this.
    if (!hasCameraHardwareMetadata && !tags.Software) {
      indicators.reasons.push("Missing physical camera hardware metadata (possible stripped or generated image)");
    }

    // 3. Check for specific C2PA/Metadata structures (more on this below)
    if (tags.CreatorTool && tags.CreatorTool.toLowerCase().includes('photoshop')) {
      // Could be edited, which is fine, but flag for secondary review if paired with zero camera data
      if (!hasCameraHardwareMetadata) {
        indicators.reasons.push("Edited in Photoshop without original camera hardware metadata");
      }
    }

    return indicators;
  } catch (error) {
    console.error("Error parsing EXIF data:", error);
    throw error;
  } finally {
    // Best practice: keep the process clean
    // exiftool.end(); // Call this on application shutdown
  }
}

While EXIF scanning is fast and easy, it has a glaring vulnerability: it is trivial to strip or spoof. Any bad actor with basic knowledge of ffmpeg or online metadata-strippers can wipe these tags in milliseconds. To build a robust system, we need to look at industry standards designed specifically to combat this.

Layer 2: The C2PA Standard and Cryptographic Provenance

C2PA provides a standard for recording and checking media provenance.

C2PA manifests contain signed provenance assertions and bindings to an asset. Changing covered content can cause validation to fail, but removing credentials can leave no manifest to inspect. Missing credentials, failed validation, and an untrusted signer are different outcomes. A valid, trusted credential does not prove that a photographed scene is real or that a listing is accurate. C2PA explainer

Architecting a C2PA Verification Pipeline

Here is an illustrative decision flow, not executable validator code. Inspect the validator's detailed results and apply an explicit trust policy. C2PA validation states

Upload → Validator
  Inspection could not complete → Inspection error; review
  No credentials located → Origin unknown
  Manifest or asset-binding checks fail → Validation failed; review
  Signer trust not established → Trust not established; review
  Validation and configured signer trust pass → Show provenance declarations

Do not equate a missing manifest with a broken signature. Do not convert an operational error into a no-credentials result.

For a report-inspection starting point, the following invocation is documented for c2patool v0.28.4. JSON output is the default. Replace the example path with your file's path. Version-specific usage

Example: Inspecting a C2PA Report (c2patool v0.28.4)

c2patool /path/to/upload.jpg

This command is not a production verification service. A zero exit status or successfully parsed JSON is not a trust verdict. Evaluate validation results and configure signer trust separately. This example was checked against the pinned documentation, not runtime-tested here. CLI source

Read AI-generation declarations from the appropriate digital source type, such as trainedAlgorithmicMedia, rather than searching a software name for “ai.” Absence of an AI declaration alone does not prove camera capture. C2PA AI guidance

Layer 3: Designing the UX for AI Disclosures

As developers, our job isn't just about parsing bytes in the backend; it's also about building intuitive, performant user interfaces that reflect this state.

An upload workflow can display supported AI-generation disclosures and route uncertain cases for review. EXIF hints alone should not produce a verified badge. These UI examples do not guarantee legal compliance; check applicable requirements separately.

A Clean React Component for AI Transparancy

This UI illustration assumes the backend has evaluated the relevant manifest, asset binding, and signer trust. Its labels describe provenance checks and declarations, not proof of a real scene.

import React from 'react';

interface ListingPhotoProps {
  src: string;
  alt: string;
  provenance: {
    declaresAiGeneration: boolean;
    hasValidatedTrustedProvenance: boolean;
    generatorName?: string;
  };
}

export const ListingPhoto: React.FC<ListingPhotoProps> = ({ src, alt, provenance }) => {
  return (
    <div className="relative overflow-hidden rounded-lg group">
      <img 
        src={src} 
        alt={alt} 
        className="w-full h-64 object-cover transition-transform duration-300 group-hover:scale-105" 
      />
      
      {/* Illustrative labels populated from backend validation and trust results */}
      <div className="absolute top-3 left-3 flex flex-col gap-2">
        {provenance.declaresAiGeneration && (
          <span className="px-3 py-1 text-xs font-semibold bg-amber-600 text-white rounded-full shadow-md flex items-center gap-1">
            <span className="w-2 h-2 rounded-full bg-white animate-pulse" />
            AI generation declared
          </span>
        )}
        
        {provenance.hasValidatedTrustedProvenance && !provenance.declaresAiGeneration && (
          <span className="px-3 py-1 text-xs font-semibold bg-emerald-600 text-white rounded-full shadow-md flex items-center gap-1">
            ✓ Provenance checks passed
          </span>
        )}
      </div>

      {provenance.declaresAiGeneration && provenance.generatorName && (
        <div className="absolute bottom-0 inset-x-0 bg-black/70 text-gray-200 text-xs p-2 text-center transform translate-y-full group-hover:translate-y-0 transition-transform duration-200">
          Declared tool: {provenance.generatorName}. Verify listing conditions independently.
        </div>
      )}
    </div>
  );
};

Conclusion: The Dev Responsibility

As regulatory pressure mounts on platforms to crack down on deceptive synthetic media, we can no longer treat image uploads as static, dumb blobs of binary data.

Metadata extraction, C2PA validation, and clear disclosures can support a more informed review process. They cannot establish a property's actual condition or guarantee compliance. Keep independent checks and a review path for uncertain uploads.

What's your take?

Are you seeing AI-generated photos creeping into your local listings? How is your team handling image verification and authenticity pipelines? Drop your thoughts, questions, or favorite EXIF tools in the comments below!

Until next time, keep coding, keep securing, and don't trust every sunlit loft you see on the web.

— Alex R.

Post a Comment

Previous Post Next Post