[tracker] tracker-extract: Add code comment explaining strange FF D8 FF check
- From: Philip Van Hoof <pvanhoof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] tracker-extract: Add code comment explaining strange FF D8 FF check
- Date: Thu, 28 Jul 2011 12:41:54 +0000 (UTC)
commit b53bdf72241bc607081ded2f121368c85178fbd2
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]