[gdk-pixbuf/issue-152] Remove the libjasper-based JPEG2000 loader



commit 59de8cb48a9051878ffb8664dc407dd7873cc295
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Wed Apr 1 16:25:26 2020 +0100

    Remove the libjasper-based JPEG2000 loader
    
    Libjasper is not really maintained any more, and has been dropped by
    various Linux distributions over the years.
    
    GdkPixbuf has not enabled the JPEG2000 loader by default in many years,
    relying on downstream distributors to do so if they also shipped
    libjasper. This means that it's unlikely anybody has relied on GdkPixbuf
    to load a JPEG2000 image for the past 3 to 5 years, if at all.
    
    The only other option for loading JPEG2000 images is to use OpenJPEG,
    and for that there is an out of tree GdkPixbuf module available:
    
    https://notabug.org/necklace/jp2-pixbuf-loader
    
    Fixes: #152, #137

 README.md                                       |   4 -
 README.msvc                                     |   3 +-
 gdk-pixbuf/gdk-pixbuf-io.c                      |   7 -
 gdk-pixbuf/io-jasper.c                          | 344 ------------------------
 gdk-pixbuf/meson.build                          |   1 -
 meson.build                                     |  30 ---
 meson_options.txt                               |   4 -
 po/POTFILES.in                                  |   1 -
 tests/pixbuf-threads.c                          |   2 -
 tests/test-images/fail/file3.jp2                | Bin 242213 -> 0 bytes
 tests/test-images/randomly-modified/valid.1.jp2 | Bin 1987968 -> 0 bytes
 11 files changed, 1 insertion(+), 395 deletions(-)
---
diff --git a/README.md b/README.md
index e95e9fc60..4f6c8bc56 100644
--- a/README.md
+++ b/README.md
@@ -34,7 +34,6 @@ Depending on the image formats you want to support you will also need:
  - libpng's development files
  - libjpeg's development files
  - libtiff's development files
- - libjasper's development files
 
 Additionally, you may need:
 
@@ -68,9 +67,6 @@ check the current build configuration, and change its options.
 
 You can specify the following options in the command line to `meson`:
 
- * `-Djasper=true` - Enable support for JPEG2000.  This requires
-   [libjasper's development files](http://www.ece.uvic.ca/~frodo/jasper/)
-   to be installed.
  * `-Ddocs=true` - Build the API reference documentation.  This
    requires `gtk-doc` to be installed.
  * `-Drelocatable=true` - Enable application bundle relocation support.
diff --git a/README.msvc b/README.msvc
index dbac333a2..c5615e17c 100644
--- a/README.msvc
+++ b/README.msvc
@@ -28,7 +28,6 @@ part of the dependency's build process.
 -IJG JPEG or libjpeg-turbo (strongly recommended, use -Djpeg=false to disable)
 -libpng (strongly recommended, use -Dpng=false to disable)
 -libtiff (strongly recommended, use -Dtiff=false to disable)
--libjasper (optional, JPEG2000 library, use -Djpaster=true to enable)
 
 1) Configure the build using Meson:
 Set the PATH, LIB, INCLUDE and PKG_CONFIG_PATH environmental variables as
@@ -37,7 +36,7 @@ needed.  Run the following in a Visual Studio command prompt:
 python $(PATH_TO_meson.py)\meson.py $(GDK_PIXBUF_SRCDIR) --buildtype=$(BUILD_CONFIG) --prefix=$(PREFIX) 
-Dman=false $(OTHER_OPTIONS)
 
 For $(OTHER_OPTIONS), the following may be of interest, besides the png,
-jpeg, japer and tiff options.  Prefix each option with -D:
+jpeg and tiff options.  Prefix each option with -D:
 
 -builtin_loaders: list of image loaders that we want to build into
  the main GDK-Pixbuf DLL, or use 'all' to include all buildable image
diff --git a/gdk-pixbuf/gdk-pixbuf-io.c b/gdk-pixbuf/gdk-pixbuf-io.c
index ce0ed633f..58bb74879 100644
--- a/gdk-pixbuf/gdk-pixbuf-io.c
+++ b/gdk-pixbuf/gdk-pixbuf-io.c
@@ -649,9 +649,6 @@ gdk_pixbuf_io_init_builtin (void)
 #ifdef INCLUDE_icns
         load_one_builtin_module (icns);
 #endif
-#ifdef INCLUDE_jasper
-        load_one_builtin_module (jasper);
-#endif
 #ifdef INCLUDE_qtif
         load_one_builtin_module (qtif);
 #endif
@@ -704,7 +701,6 @@ module (bmp);
 module (xbm);
 module (tga);
 module (icns);
-module (jasper);
 module (qtif);
 module (gdip_ico);
 module (gdip_wmf);
@@ -785,9 +781,6 @@ gdk_pixbuf_load_module_unlocked (GdkPixbufModule *image_module,
 #ifdef INCLUDE_icns
         try_module (icns,icns);
 #endif
-#ifdef INCLUDE_jasper
-        try_module (jasper,jasper);
-#endif
 #ifdef INCLUDE_qtif
         try_module (qtif,qtif);
 #endif
diff --git a/gdk-pixbuf/meson.build b/gdk-pixbuf/meson.build
index 12f6ddbb1..fdf98da52 100644
--- a/gdk-pixbuf/meson.build
+++ b/gdk-pixbuf/meson.build
@@ -20,7 +20,6 @@ loaders = [
   [ 'xbm', [ 'io-xbm.c' ] ],
   [ 'tga', [ 'io-tga.c', 'gdk-pixbuf-buffer-queue.c' ] ],
   [ 'icns', [ 'io-icns.c' ] ],
-  [ 'jasper', [ 'io-jasper.c' ], enabled_loaders.contains('jasper'), jasper_extra_cflags ],
   [ 'qtif', [ 'io-qtif.c' ] ]
 ]
 
diff --git a/meson.build b/meson.build
index 6aebaed1d..e501c678b 100644
--- a/meson.build
+++ b/meson.build
@@ -347,36 +347,6 @@ if get_option('tiff') and not native_windows_loaders
   endif
 endif
 
-jasper_extra_cflags = []
-
-if get_option('jasper')
-  has_jasper_header = false
-
-  if cc.get_id() == 'msvc'
-    # We must define JAS_WIN_MSVC_BUILD before including jasper/jasper.h on MSVC
-    jasper_msvc_macro = 'JAS_WIN_MSVC_BUILD'
-    has_jasper_header = cc.has_header('jasper/jasper.h', prefix: '#define @0@'.format(jasper_msvc_macro))
-    jasper_extra_cflags = [ '-D@0@'.format(jasper_msvc_macro) ]
-  else
-    has_jasper_header = cc.has_header('jasper/jasper.h')
-  endif
-
-  if has_jasper_header
-    jasper_dep = cc.find_library('jasper', required: false)
-    if not jasper_dep.found()
-      if cc.get_id() == 'msvc'
-        # on MSVC, we need to look for libjasper.lib if jasper.lib is not found,
-        # which corresponds to what libjasper's MSVC projects produce
-        jasper_dep = cc.find_library('libjasper', required: false)
-      endif
-    endif
-    if jasper_dep.found() and cc.has_function('jas_init', dependencies: jasper_dep)
-      enabled_loaders += 'jasper'
-      loaders_deps += jasper_dep
-    endif
-  endif
-endif
-
 # Determine whether we enable application bundle relocation support, and we use
 # this always on Windows
 if host_system == 'windows'
diff --git a/meson_options.txt b/meson_options.txt
index 1add5a86b..a2a90504f 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -10,10 +10,6 @@ option('jpeg',
        description: 'Enable JPEG loader (requires libjpeg), disabled on Windows if "native_windows_loaders" 
is used',
        type: 'boolean',
        value: true)
-option('jasper',
-       description: 'Enable JPEG2000 loader (requires libjasper)',
-       type: 'boolean',
-       value: false)
 option('builtin_loaders',
        description: 'Comma-separated list of loaders to build into gdk-pixbuf, or "none", or "all" to build 
all buildable loaders into gdk-pixbuf',
        type: 'string',
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 138e05526..bc6aa5501 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -19,7 +19,6 @@ gdk-pixbuf/io-gdip-wmf.c
 gdk-pixbuf/io-gif.c
 gdk-pixbuf/io-icns.c
 gdk-pixbuf/io-ico.c
-gdk-pixbuf/io-jasper.c
 gdk-pixbuf/io-jpeg.c
 gdk-pixbuf/io-png.c
 gdk-pixbuf/io-pnm.c
diff --git a/tests/pixbuf-threads.c b/tests/pixbuf-threads.c
index fdcf4389f..1326eeca4 100644
--- a/tests/pixbuf-threads.c
+++ b/tests/pixbuf-threads.c
@@ -89,8 +89,6 @@ test_threads (void)
         g_thread_pool_push (pool, "valid.1.tga", NULL);
       if (format_supported ("tiff"))
         g_thread_pool_push (pool, "valid.1.tiff", NULL);
-      if (format_supported ("jp2"))
-        g_thread_pool_push (pool, "valid.1.jp2", NULL);
     }
 
   g_thread_pool_free (pool, FALSE, TRUE);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]