• Show log

    Commit

  • Hash : f74989d8
    Author : DRC
    Date : 2025-09-25T11:32:45

    Clean up #include directives
    
    This is subtle, but #include <header.h> searches directories specified
    with -I, then system include directories.  #include "header.h" searches
    the current source directory, then directories specified with -I, then
    system include directories.
    
    Using bracketed #include directives for jpeglib.h, jinclude.h, jerror.h,
    cdjpeg.h, and turbojpeg.h only worked because the build system
    explicitly passed -I{source_directory}/src/ to the compiler.  Referring
    to 51cee0362998ec6f1eabac1e795f3b6e3ee639ea, it's better for the source
    code to have as few dependencies on our specific build system as
    possible.
    
    Since jpeglib.h, jinclude.h, jerror.h, and turbojpeg.h can be installed
    in system include directories, it's also better for internal references
    to those headers to resolve internally first, to avoid potential
    conflicts between the system-installed version of libjpeg-turbo and the
    version being built.  (Such conflicts would never have occurred with our
    build system, but they might have occurred due to misintegration with a
    downstream build system.)
    

  • Properties

  • Git HTTP https://git.kmx.io/kc3-lang/libjpeg-turbo.git
    Git SSH git@git.kmx.io:kc3-lang/libjpeg-turbo.git
    Public access ? public
    Description

    Fork of libjpeg with SIMD

    Users
    thodg_m kc3_lang_org thodg_w www_kmx_io thodg_l thodg
    Tags

  • README

  • TurboJPEG Java Wrapper
    ======================
    
    The TurboJPEG shared library can optionally be built with a Java Native
    Interface wrapper, which allows the library to be loaded and used directly from
    Java applications.  The Java front end for this is defined in several classes
    located under org/libjpegturbo/turbojpeg.  The source code for these Java
    classes is licensed under a BSD-style license, so the files can be incorporated
    directly into both open source and proprietary projects without restriction.  A
    Java archive (JAR) file containing these classes is also shipped with the
    "official" distribution packages of libjpeg-turbo.
    
    TJComp.java, TJDecomp.java, and TJTran.java, which should be located in the
    same directory as this README file, demonstrate how to use the TurboJPEG Java
    API to compress, decompress, and transform JPEG images in memory.
    
    
    Performance Pitfalls
    --------------------
    
    The TurboJPEG Java API defines several convenience methods that can allocate
    image buffers or instantiate classes to hold the result of compress,
    decompress, or transform operations.  However, if you use these methods, then
    be mindful of the amount of new data you are creating on the heap.  It may be
    necessary to manually invoke the garbage collector to prevent heap exhaustion
    or to prevent performance degradation.  Background garbage collection can kill
    performance, particularly in a multi-threaded environment (Java pauses all
    threads when the GC runs.)
    
    The TurboJPEG Java API always gives you the option of pre-allocating your own
    source and destination buffers, which allows you to re-use those buffers for
    compressing/decompressing multiple images.  If the image sequence you are
    compressing or decompressing consists of images of the same size, then
    pre-allocating the buffers is recommended.
    
    
    Installation Directory
    ----------------------
    
    The TurboJPEG Java Wrapper will look for the TurboJPEG JNI library
    (libturbojpeg.so, libturbojpeg.dylib, or turbojpeg.dll) in the system library
    paths or in any paths specified in LD_LIBRARY_PATH (Un*x), DYLD_LIBRARY_PATH
    (Mac), or PATH (Windows.)  Failing this, on Un*x and Mac systems, the wrapper
    will look for the JNI library under the library directory configured when
    libjpeg-turbo was built.  If that library directory is
    /opt/libjpeg-turbo/lib32, then /opt/libjpeg-turbo/lib64 is also searched, and
    vice versa.
    
    If you installed the JNI library into another directory, then you will need
    to pass an argument of -Djava.library.path={path_to_JNI_library} to java, or
    manipulate LD_LIBRARY_PATH, DYLD_LIBRARY_PATH, or PATH to include the directory
    containing the JNI library.