gnome-commander r1958 - in branches/gcmd-1-3: . src/tags
- From: epiotr svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-commander r1958 - in branches/gcmd-1-3: . src/tags
- Date: Sat, 9 Aug 2008 19:39:08 +0000 (UTC)
Author: epiotr
Date: Sat Aug 9 19:39:08 2008
New Revision: 1958
URL: http://svn.gnome.org/viewvc/gnome-commander?rev=1958&view=rev
Log:
Do not search metatags for non-pdf documents
Modified:
branches/gcmd-1-3/ChangeLog
branches/gcmd-1-3/src/tags/gnome-cmd-tags-poppler.cc
Modified: branches/gcmd-1-3/src/tags/gnome-cmd-tags-poppler.cc
==============================================================================
--- branches/gcmd-1-3/src/tags/gnome-cmd-tags-poppler.cc (original)
+++ branches/gcmd-1-3/src/tags/gnome-cmd-tags-poppler.cc Sat Aug 9 19:39:08 2008
@@ -301,10 +301,12 @@
if (!finfo->metadata) return;
finfo->metadata->mark_as_accessed(TAG_PDF);
- finfo->metadata->mark_as_accessed(TAG_DOC);
if (!gnome_cmd_file_is_local (finfo)) return;
+ // skip non pdf files, as pdf metatags extraction is very expensive...
+ if (!strstr (finfo->info->mime_type, "pdf")) return;
+
gchar *fname = gnome_cmd_file_get_real_path (finfo);
DEBUG('t', "Loading PDF metadata for '%s'\n", fname);
@@ -316,6 +318,8 @@
if (!doc.isOk())
return;
+ finfo->metadata->mark_as_accessed(TAG_DOC);
+
finfo->metadata->addf(TAG_PDF_VERSION, "%.1f", doc.getPDFVersion());
finfo->metadata->addf(TAG_DOC_PAGECOUNT, "%i", doc.getNumPages());
finfo->metadata->addf(TAG_PDF_OPTIMIZED, "%u", doc.isLinearized());
@@ -331,7 +335,7 @@
finfo->metadata->addf(TAG_PDF_ACCESSIBILITYSUPPORT, "%u", doc.okToAccessibility());
finfo->metadata->addf(TAG_PDF_DOCASSEMBLY, "%u", doc.okToAssemble());
- if (doc.getPDFVersion()>0)
+ if (doc.getNumPages()>0)
{
double width = doc.getPageCropWidth(1)/72.0f*25.4f;
double height = doc.getPageCropHeight(1)/72.0f*25.4f;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]