12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- /* GdkPixbuf library - JPEG2000 Image Loader
- *
- * Copyright © 2020 - 2024 Nichlas Severinsen
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
- #include <gdk-pixbuf/gdk-pixbuf.h>
- gint main(gint argc, gchar **argv)
- {
- int width, height, rowstride, components;
- guchar *pixels;
- GError *error = NULL;
- gchar **env = g_get_environ();
- g_warning("%s", g_environ_getenv(env, "TEST_FILE"));
- GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file(g_environ_getenv(env, "TEST_FILE"), &error);
- if(error)
- {
- g_error("%s", error->message);
- }
- g_assert(error == NULL);
- // gdk_pixbuf_rotate_simple(pixbuf, GDK_PIXBUF_ROTATE_COUNTERCLOCKWISE);
- GdkPixbuf *flipped = gdk_pixbuf_rotate_simple(pixbuf, GDK_PIXBUF_ROTATE_COUNTERCLOCKWISE); // gdk_pixbuf_flip(pixbuf, (gboolean) TRUE);
- if(flipped == NULL)
- {
- g_error("Failed flipping image");
- }
- g_assert(flipped != NULL);
- gdk_pixbuf_save(flipped, "test_save.jp2", "jp2", &error, NULL);
- if(error)
- {
- g_error("%s", error->message);
- }
- g_assert(error == NULL);
- return 0;
- }
|