Fossil

Check-in [ff53d5ab]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:make correction on image/png magic for mimetype detection
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:ff53d5ab3e9a46b0a898833029bd405c40b392f7
User & Date: bch 2010-12-30 02:15:02
Context
2010-12-30
14:03
Add documentation on how the build process works. check-in: c429b524 user: drh tags: trunk
02:15
make correction on image/png magic for mimetype detection check-in: ff53d5ab user: bch tags: trunk
01:29
follow-up to [e22fca9640|Hex adjustment checkin]; an image -is- a binary file already - no need to display a "Hex" link for it explicitly (already done). check-in: fab89453 user: bch tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/doc.c.

47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
  static const struct {
    const char *zPrefix;       /* The file prefix */
    int size;                  /* Length of the prefix */
    const char *zMimetype;     /* The corresponding mimetype */
  } aMime[] = {
    { "GIF87a",                  6, "image/gif"  },
    { "GIF89a",                  6, "image/gif"  },
    { "\211PNG\r\n\032\r",       8, "image/png"  },
    { "\377\332\377",            3, "image/jpeg" },
    { "\377\330\377",            3, "image/jpeg" },
  };

  x = (const unsigned char*)blob_buffer(pBlob);
  n = blob_size(pBlob);
  for(i=0; i<n; i++){







|







47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
  static const struct {
    const char *zPrefix;       /* The file prefix */
    int size;                  /* Length of the prefix */
    const char *zMimetype;     /* The corresponding mimetype */
  } aMime[] = {
    { "GIF87a",                  6, "image/gif"  },
    { "GIF89a",                  6, "image/gif"  },
    { "\211PNG\r\n\032\n",       8, "image/png"  },
    { "\377\332\377",            3, "image/jpeg" },
    { "\377\330\377",            3, "image/jpeg" },
  };

  x = (const unsigned char*)blob_buffer(pBlob);
  n = blob_size(pBlob);
  for(i=0; i<n; i++){