[tracker/tracker-0.10] tracker-extract: Add code comment explaining strange FF D8 FF check
- From: Martyn James Russell <mr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/tracker-0.10] tracker-extract: Add code comment explaining strange FF D8 FF check
- Date: Mon, 1 Aug 2011 16:21:42 +0000 (UTC)
commit e114d009ef29c309f38526ed13bd4cd6e596417f
Author: Philip Van Hoof <philip codeminded be>
Date: Thu Jul 28 14:41:33 2011 +0200
tracker-extract: Add code comment explaining strange FF D8 FF check
src/tracker-extract/tracker-albumart-pixbuf.c | 1 +
src/tracker-extract/tracker-albumart-qt.cpp | 1 +
2 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/src/tracker-extract/tracker-albumart-pixbuf.c b/src/tracker-extract/tracker-albumart-pixbuf.c
index 4557b1c..cd943a6 100644
--- a/src/tracker-extract/tracker-albumart-pixbuf.c
+++ b/src/tracker-extract/tracker-albumart-pixbuf.c
@@ -67,6 +67,7 @@ tracker_albumart_buffer_to_jpeg (const unsigned char *buffer,
const gchar *buffer_mime,
const gchar *target)
{
+ /* FF D8 FF are the three first bytes of JPeg images */
if ((g_strcmp0 (buffer_mime, "image/jpeg") == 0 ||
g_strcmp0 (buffer_mime, "JPG") == 0) &&
(buffer && len > 2 && buffer[0] == 0xff && buffer[1] == 0xd8 && buffer[2] == 0xff)) {
diff --git a/src/tracker-extract/tracker-albumart-qt.cpp b/src/tracker-extract/tracker-albumart-qt.cpp
index 95cb3de..00597d9 100644
--- a/src/tracker-extract/tracker-albumart-qt.cpp
+++ b/src/tracker-extract/tracker-albumart-qt.cpp
@@ -91,6 +91,7 @@ tracker_albumart_buffer_to_jpeg (const unsigned char *buffer,
const gchar *buffer_mime,
const gchar *target)
{
+ /* FF D8 FF are the three first bytes of JPeg images */
if ((g_strcmp0 (buffer_mime, "image/jpeg") == 0 ||
g_strcmp0 (buffer_mime, "JPG") == 0) &&
(buffer && len > 2 && buffer[0] == 0xff && buffer[1] == 0xd8 && buffer[2] == 0xff)) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]