add some upgrade comments (#457)
these document improvements and/or removal of unnecessary code for when we will require a higher minimum version of Imlib2. all the comments have been prefixed with "UPGRADE: " for easy grepping. Reviewed-on: https://codeberg.org/nsxiv/nsxiv/pulls/457 Reviewed-by: explosion-mental <explosion-mental@noreply.codeberg.org>
This commit is contained in:
parent
9b122c82fa
commit
c1b36b8f09
3
image.c
3
image.c
|
@ -563,6 +563,8 @@ Imlib_Image img_open(const fileinfo_t *file)
|
||||||
{
|
{
|
||||||
imlib_context_set_image(im);
|
imlib_context_set_image(im);
|
||||||
}
|
}
|
||||||
|
/* UPGRADE: Imlib2 v1.10.0: better error reporting with
|
||||||
|
* imlib_get_error() + imlib_strerror() */
|
||||||
if (im == NULL && (file->flags & FF_WARN))
|
if (im == NULL && (file->flags & FF_WARN))
|
||||||
error(0, 0, "%s: Error opening image", file->name);
|
error(0, 0, "%s: Error opening image", file->name);
|
||||||
return im;
|
return im;
|
||||||
|
@ -581,6 +583,7 @@ bool img_load(img_t *img, const fileinfo_t *file)
|
||||||
*/
|
*/
|
||||||
imlib_image_set_changes_on_disk();
|
imlib_image_set_changes_on_disk();
|
||||||
|
|
||||||
|
/* UPGRADE: Imlib2 v1.7.5: remove these exif related ifdefs */
|
||||||
/* since v1.7.5, Imlib2 can parse exif orientation from jpeg files.
|
/* since v1.7.5, Imlib2 can parse exif orientation from jpeg files.
|
||||||
* this version also happens to be the first one which defines the
|
* this version also happens to be the first one which defines the
|
||||||
* IMLIB2_VERSION macro.
|
* IMLIB2_VERSION macro.
|
||||||
|
|
2
nsxiv.h
2
nsxiv.h
|
@ -159,7 +159,7 @@ typedef keymap_t button_t;
|
||||||
|
|
||||||
/* image.c */
|
/* image.c */
|
||||||
|
|
||||||
#ifdef IMLIB2_VERSION
|
#ifdef IMLIB2_VERSION /* UPGRADE: Imlib2 v1.8.0: remove all HAVE_IMLIB2_MULTI_FRAME ifdefs */
|
||||||
#if IMLIB2_VERSION >= IMLIB2_VERSION_(1, 8, 0)
|
#if IMLIB2_VERSION >= IMLIB2_VERSION_(1, 8, 0)
|
||||||
#define HAVE_IMLIB2_MULTI_FRAME 1
|
#define HAVE_IMLIB2_MULTI_FRAME 1
|
||||||
#endif
|
#endif
|
||||||
|
|
1
thumbs.c
1
thumbs.c
|
@ -268,6 +268,7 @@ bool tns_load(tns_t *tns, int n, bool force, bool cache_only)
|
||||||
char tmppath[] = "/tmp/nsxiv-XXXXXX";
|
char tmppath[] = "/tmp/nsxiv-XXXXXX";
|
||||||
Imlib_Image tmpim;
|
Imlib_Image tmpim;
|
||||||
|
|
||||||
|
/* UPGRADE: Imlib2 v1.10.0: avoid tempfile and use imlib_load_image_mem() */
|
||||||
if ((ed = exif_data_new_from_file(file->path)) != NULL) {
|
if ((ed = exif_data_new_from_file(file->path)) != NULL) {
|
||||||
if (ed->data != NULL && ed->size > 0 &&
|
if (ed->data != NULL && ed->size > 0 &&
|
||||||
(tmpfd = mkstemp(tmppath)) >= 0)
|
(tmpfd = mkstemp(tmppath)) >= 0)
|
||||||
|
|
Loading…
Reference in New Issue