summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/pixbuf-jpeg.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/pixbuf-jpeg.c b/tests/pixbuf-jpeg.c
index d03384e42..3b1f2e4f0 100644
--- a/tests/pixbuf-jpeg.c
+++ b/tests/pixbuf-jpeg.c
@@ -137,6 +137,39 @@ test_at_size (void)
g_object_unref (ref);
}
+static void
+test_jpeg_markers (void)
+{
+ GdkPixbufLoader *loader;
+ GdkPixbuf *pixbuf;
+ GError *error = NULL;
+ gchar *contents;
+ gsize size;
+
+ if (!format_supported ("jpeg"))
+ {
+ g_test_skip ("format not supported");
+ return;
+ }
+
+ g_file_get_contents (g_test_get_filename (G_TEST_DIST, "issue70.jpg", NULL), &contents, &size, &error);
+ g_assert_no_error (error);
+
+ loader = gdk_pixbuf_loader_new ();
+
+ gdk_pixbuf_loader_write (loader, (const guchar*)contents, size, &error);
+ g_assert_no_error (error);
+
+ gdk_pixbuf_loader_close (loader, &error);
+ g_assert_no_error (error);
+
+ pixbuf = gdk_pixbuf_loader_get_pixbuf (loader);
+ g_assert_nonnull (pixbuf);
+
+ g_object_unref (loader);
+ g_free (contents);
+}
+
int
main (int argc, char **argv)
{
@@ -147,6 +180,7 @@ main (int argc, char **argv)
g_test_add_func ("/pixbuf/jpeg/bug775218", test_bug_775218);
g_test_add_func ("/pixbuf/jpeg/comment", test_comment);
g_test_add_func ("/pixbuf/jpeg/at_size", test_at_size);
+ g_test_add_func ("/pixbuf/jpeg/issue70", test_jpeg_markers);
return g_test_run ();
}