Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 632373
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T20:04:09+00:00 2026-05-13T20:04:09+00:00

I’d like to screen some jpegs for validity before I send them across the

  • 0

I’d like to screen some jpegs for validity before I send them across the network for more extensive inspection. It is easy enough to check for a valid header and footer, but what is the smallest size (in bytes) a valid jpeg could be?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T20:04:09+00:00Added an answer on May 13, 2026 at 8:04 pm

    A 1×1 grey pixel in 125 bytes using arithmetic coding, still in the JPEG standard even if most decoders can’t decode it:

    ff d8 : SOI
    ff e0 ; APP0
     00 10
     4a 46 49 46 00 01 01 01 00 48 00 48 00 00
    ff db ; DQT
     00 43
     00
     03 02 02 02 02 02 03 02
     02 02 03 03 03 03 04 06
     04 04 04 04 04 08 06 06
     05 06 09 08 0a 0a 09 08
     09 09 0a 0c 0f 0c 0a 0b
     0e 0b 09 09 0d 11 0d 0e
     0f 10 10 11 10 0a 0c 12
     13 12 10 13 0f 10 10 10
    ff c9 ; SOF
     00 0b
     08 00 01 00 01 01 01 11 00
    ff cc ; DAC
     00 06 00 10 10 05
    ff da ; SOS
     00 08
     01 01 00 00 3f 00 d2 cf 20
    ff d9 ; EOI
    

    I don’t think the mentioned 134 byte example is standard, as it is missing an EOI. All decoders will handle this but the standard says it should end with one.

    That file can be generated with:

    #!/usr/bin/env bash
    printf '\xff\xd8' # SOI
    printf '\xff\xe0' # APP0
    printf  '\x00\x10'
    printf  '\x4a\x46\x49\x46\x00\x01\x01\x01\x00\x48\x00\x48\x00\x00'
    printf '\xff\xdb' # DQT
    printf  '\x00\x43'
    printf  '\x00'
    printf  '\x03\x02\x02\x02\x02\x02\x03\x02'
    printf  '\x02\x02\x03\x03\x03\x03\x04\x06'
    printf  '\x04\x04\x04\x04\x04\x08\x06\x06'
    printf  '\x05\x06\x09\x08\x0a\x0a\x09\x08'
    printf  '\x09\x09\x0a\x0c\x0f\x0c\x0a\x0b'
    printf  '\x0e\x0b\x09\x09\x0d\x11\x0d\x0e'
    printf  '\x0f\x10\x10\x11\x10\x0a\x0c\x12'
    printf  '\x13\x12\x10\x13\x0f\x10\x10\x10'
    printf '\xff\xc9' # SOF
    printf  '\x00\x0b'
    printf  '\x08\x00\x01\x00\x01\x01\x01\x11\x00'
    printf '\xff\xcc' # DAC
    printf  '\x00\x06\x00\x10\x10\x05'
    printf '\xff\xda' # SOS
    printf  '\x00\x08'
    printf  '\x01\x01\x00\x00\x3f\x00\xd2\xcf\x20'
    printf '\xff\xd9' # EOI
    

    and opened fine with GNOME Image Viewer 3.38.0 and GIMP 2.10.18 on Ubuntu 20.10.

    Alternative way of generating this image:
    echo ffd8ffe000104a46494600010101004800480000ffdb004300030202020202030202020303030304060404040404080606050609080a0a090809090a0c0f0c0a0b0e0b09090d110d0e0f101011100a0c12131210130f101010ffc9000b080001000101011100ffcc000600101005ffda0008010100003f00d2cf20ffd9 | xxd -r -p > small.jpg

    Here’s an upload on Imgur. Note that Imgur process the file making it larger however if you download it to check, and as seen below, the width=100 image shows white on Chromium 87:

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For some reason, after submitting a string like this Jack’s Spindle from a text
I have some data like this: 1 2 3 4 5 9 2 6
I've got a string that has curly quotes in it. I'd like to replace
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have text I am displaying in SIlverlight that is coming from a CMS
I want to count how many characters a certain string has in PHP, but
I used javascript for loading a picture on my website depending on which small
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on
I have a JSP page retrieving data and when single or double quotes are

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.