Re: Voyager - Image viewer in Vala
Posted: 04 Aug 2014, 17:25
Here it is_ for a test:
You will notice that newly created image is much smaller file size...
Code: Select all
// valac test.vala --pkg gtk+-3.0 --target-glib=2.38
int main()
{
Gdk.Pixbuf pix = new Gdk.Pixbuf.from_file("/usr/share/backgrounds/default.jpg");
Gdk.Pixbuf pixr = pix.rotate_simple(Gdk.PixbufRotation.CLOCKWISE);
// save rotated 270
pixr.save("/root/default270.jpg", "jpeg", null);
pixr = pixr.rotate_simple(Gdk.PixbufRotation.COUNTERCLOCKWISE);
// save rotated 0
pixr.save("/root/default0.jpg", "jpeg", null);
return 0;
}
You will notice that newly created image is much smaller file size...