[poppler] benchmark: ChangeLog,1.1,1.2 benchmark.c,1.1.1.1,1.2

Jeff Muizelaar jrmuizel at freedesktop.org
Sun Apr 24 13:54:11 PDT 2005


Update of /cvs/poppler/benchmark
In directory gabe:/tmp/cvs-serv8267

Modified Files:
	ChangeLog benchmark.c 
Log Message:
2005-04-24  Jeff Muizelaar  <jeff at infidigm.net>

	* benchmark.c (main): make argv[1] a filename instead
	of a uri. Also make progress meter complete properly.



Index: ChangeLog
===================================================================
RCS file: /cvs/poppler/benchmark/ChangeLog,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- ChangeLog	21 Apr 2005 23:22:00 -0000	1.1
+++ ChangeLog	24 Apr 2005 20:54:08 -0000	1.2
@@ -1,3 +1,8 @@
+2005-04-24  Jeff Muizelaar  <jeff at infidigm.net>
+
+	* benchmark.c (main): make argv[1] a filename instead
+	of a uri. Also make progress meter complete properly.
+
 Thu Apr 21 19:16:30 2005  Kristian Høgsberg  <krh at redhat.com>
 
 	Imported benchmark programs from Jeff Muizelaar.

Index: benchmark.c
===================================================================
RCS file: /cvs/poppler/benchmark/benchmark.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- benchmark.c	21 Apr 2005 23:18:57 -0000	1.1.1.1
+++ benchmark.c	24 Apr 2005 20:54:08 -0000	1.2
@@ -9,7 +9,7 @@
 {
   PopplerDocument *document;
   PopplerPage *page;
-  char *filename, *title, *label;
+  char *uri, *filename, *title, *label;
   GError *error;
   GdkPixbuf *pixbuf;
   double width, height;
@@ -19,13 +19,15 @@
   if (filename == NULL)
     FAIL ("specify filename");
 
+  uri = g_filename_to_uri(filename, NULL, NULL);
   g_type_init ();
 
   error = NULL;
-  document = poppler_document_new_from_file (argv[1], NULL, &error);
+  document = poppler_document_new_from_file (uri, NULL, &error);
+  g_free(uri);
   if (document == NULL)
     FAIL (error->message);
-      
+
   g_object_get (document, "title", &title, NULL);
   g_strstrip (title);
   printf ("document title: %s\n", title);
@@ -37,7 +39,7 @@
   n_pages = poppler_document_get_n_pages (document);
   printf("\n");
   for (i = 0; i < n_pages; i++) {
-    printf("\rrendering page %4d / %d", i, n_pages);
+    printf("\rrendering page %4d / %d", i + 1, n_pages);
     fflush(stdout);
     page = poppler_document_get_page (document, i);
     poppler_page_render_to_pixbuf (page, 300, 300, 50, 50, 1, pixbuf, 10, 10);



More information about the poppler mailing list