libragephoto: add new ragephotodata functions and improvements

RagePhoto: changed photo(), photoData(), photoSize() and setPhoto() to
jpeg(), jpegData(), jpegSize() and setJpeg()
RagePhoto: setData() now takes takeCopy instead of takeOwnership
RagePhoto: changed static member argument order for easier coding
RagePhotoA: changed photo(), photoData(), photoSize() and setPhoto() to
jpeg(), jpegData(), jpegSize() and setJpeg()
RagePhotoA: setData() now takes takeCopy instead of takeOwnership
RagePhotoA: changed static member argument order for easier coding
RagePhotoA: add new C API functions
RagePhotoC: add ragephotodata_save() and ragephotodata_savef()
RagePhoto-Extract: update for API changes, stop assuming RDR 2 when GTA
V format not found
ragephoto-gtkviewer: update for API changes
ragephoto-qtviewer: update for API changes
This commit is contained in:
Syping 2023-02-23 09:17:53 +01:00
parent 9807f0d696
commit d75eba2a46
9 changed files with 237 additions and 182 deletions

View file

@ -1,6 +1,6 @@
/*****************************************************************************
* libragephoto RAGE Photo Parser
* Copyright (C) 2021-2022 Syping
* Copyright (C) 2021-2023 Syping
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
@ -48,7 +48,7 @@ bool readPhotoFile(const std::string &filename, Gtk::Window *win, Gtk::Image *im
}
}
GdkPixbufLoader *pixbuf_loader = gdk_pixbuf_loader_new();
gdk_pixbuf_loader_write(pixbuf_loader, reinterpret_cast<const guchar*>(ragePhoto.photoData()), ragePhoto.photoSize(), NULL);
gdk_pixbuf_loader_write(pixbuf_loader, reinterpret_cast<const guchar*>(ragePhoto.jpegData()), ragePhoto.jpegSize(), NULL);
GdkPixbuf *pixbuf = gdk_pixbuf_loader_get_pixbuf(pixbuf_loader);
gdk_pixbuf_loader_close(pixbuf_loader, NULL);
image->set(Glib::wrap(pixbuf));