⛵ The missing small and fast image decoding library for humans (not for machines).

Overview

Squirrel Abstract Image Library

The missing fast and easy-to-use image decoding library for humans (not for machines).

Travis Build Status Language grade: C/C++ Coverity Scan Build Status Latest release

Target AudienceFeaturesImage FormatsGetting StartedExamplesFAQ

SAIL is a format-agnostic cross-platform image decoding library providing rich APIs, from one-liners to complex use cases with custom I/O sources. It enables a client to read and write static, animated, multi-paged images along with their meta data and ICC profiles.

GIF Demo Screenshot

Target audience

  • Image viewers
  • Game developers
  • Anyone who needs to load or save images in different image formats and who needs a clean and comprehensive API for that

Features overview

  • Easy-to-use thread-safe C and C++ interfaces
  • Versatile APIs: junior, advanced, deep diver, and technical diver
  • Input/output: files, memory, custom I/O streams
  • Load by file suffixes, paths, and magic numbers
  • Output pixels as close as possible to the source
  • Meta data support: text comments, EXIF, ICC profiles
  • Access to the image properties w/o decoding pixels (probing)
  • Access to the source image properties
  • Adding or updating image codecs with ease demonstrated by Intel [*]
  • The best MIME icons in the computer industry 😄

* One day Intel demonstrated the advantages of their IPP technology in speeding up decoding JPEG and JPEG2000 images with the help of ksquirrel-libs, the predecessor of SAIL.

Features NOT provided

  • Image editing capabilities (filtering, distortion, scaling, etc.)
  • Color space conversion functions
  • Color management functions (applying ICC profiles etc.)
  • EXIF rotation

Supported image formats

N Image format Operations Dependencies
1 APNG R libpng+APNG patch
2 AVIF R libavif
3 BMP R
4 GIF R giflib
5 JPEG RW libjpeg-turbo
6 JPEG2000 R jasper
7 PNG RW libpng
8 SVG R resvg
9 TGA R
10 TIFF RW libtiff
.. ...
12 WEBP R libwebp

See the full list here. Work to add more image formats is ongoing.

Benchmarks

Benchmark

Time to load and output default pixels (without explicit conversion) was measured. See BENCHMARKS.

Preferred installation method

  • Windows: vcpkg
  • macOS: brew
  • Linux: native packages if available or vcpkg

See BUILDING.

APIs overview

SAIL provides four levels of APIs, depending on your needs. Let's have a quick look at the junior level.

C:

struct sail_image *image;

SAIL_TRY(sail_read_file(path, &image));

/*
 * Handle the image pixels here.
 * Use image->width, image->height, image->bytes_per_line,
 * image->pixel_format, and image->pixels for that.
 *
 * In particular, you can convert it to a different pixel format with functions
 * from libsail-manip. With sail_convert_image(), for example.
 */

sail_destroy_image(image);

C++:

sail::image image(path);

// Handle the image and its pixels here.
// Use image.width(), image.height(), image.bytes_per_line(),
// image.pixel_format(), and image.pixels() for that.
//
// In particular, you can convert it to a different pixel format with image::convert().

It's pretty easy, isn't it? 😄 See EXAMPLES and FAQ for more.

Programming languages

Programming language: C11
Bindings: C++17

Competitors

Differences from other image decoding libraries

  • Easily extensible with new image format plugins
  • Easy-to-use API providing expected business entities - images, palettes, pixels etc.
  • Access to source pixel data (supported by the most codecs)
  • Access to the image properties w/o decoding pixel data (probing)

Development status

SAIL is ready for every day use. However, it's still under heavy development. The API can be changed at any time breaking binary and source compatibility. Consider opening a GitHub issue if you have any feature requests or issue reports. Your help (pull requests etc.) is highly welcomed.

Have questions or issues?

Opening a GitHub issue is the preferred way of communicating and solving problems.

See FAQ for more.

Architecture overview

SAIL is written in pure C11 w/o using any third-party libraries (except for codecs). It also provides bindings to C++.

SAIL codecs

SAIL codecs is the deepest level. This is a set of standalone, dynamically loaded codecs (SO on Linux and DLL on Windows). They implement actual decoding and encoding capabilities. End-users never work with codecs directly. They always use abstract, high-level APIs in libsail for that.

Every codec is accompanied with a so called codec info (description) file which is just a plain text file. It describes what the codec can actually do: what pixel formats it can read and output, what compression types it supports, and more.

By default, SAIL loads codecs on demand. To preload them, use sail_init_with_flags(SAIL_FLAG_PRELOAD_CODECS).

libsail-common

libsail-common holds common data types (images, pixel formats, I/O abstractions etc.) and a small set of functions shared between SAIL codecs and the high-level APIs in libsail.

libsail

libsail is a feature-rich, high-level API. It provides comprehensive and lightweight interfaces to decode and encode images. End-users implementing C applications always work with libsail.

libsail-manip

libsail-manip is a collection of image manipulation functions. For example, conversion functions from one pixel format to another.

libsail-c++

libsail-c++ is a C++ binding to libsail. End-users implementing C++ applications may choose between libsail and libsail-c++. Using libsail-c++ is always recommended, as it's much more simple to use in C++ applications.

Building

See BUILDING.

Philosophy

Philosophy of SAIL is modularization and simplicity.

Image codecs are architectured to be standalone dynamically loaded files. Any future hypothetical improvements will be implemented as separate client libraries. So a user is always able to choose what to use (i.e. to link against) and what not to use.

Support

If you like the project, please consider starring the repository.

Author

Dmitry Baryshev

License

Released under the MIT license.

Copyright (c) 2020 Dmitry Baryshev

The MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Comments
  • Fix cmake object libraries in static build

    Fix cmake object libraries in static build

    Hi again,

    SAIL's static build was sadly broken for me since commit ce0e3d2824936013083fdc8219a1f3916cc3ebbc. SAIL could still be built statically but the sail-codecs-objects archive produced by the build didn't contain the private bmp-common library that's shared by the BMP and ICO codecs. That meant linking with SAIL failed because the symbols from bmp-common were missing.

    I've tried to fix this by making common libraries like bmp-common build as object libraries as well, just like the codecs themselves. This fixes the static build for me.

    I'm not sure if I broke other things in the process though so I'd be quite happy if you could review my changes when you have time!

    opened by JoniSt 10
  • Bug: Copying a default-constructed sail::palette raises SAIL_ERROR_UNSUPPORTED_PIXEL_FORMAT

    Bug: Copying a default-constructed sail::palette raises SAIL_ERROR_UNSUPPORTED_PIXEL_FORMAT

    Hi,

    I've found a bug in the following function:

    // palette-c++.cpp
    palette& palette::with_data(SailPixelFormat pixel_format, const arbitrary_data &data)
    {
        unsigned bits_per_pixel;
        SAIL_TRY_OR_SUPPRESS(sail_bits_per_pixel(pixel_format, &bits_per_pixel));
    
        const unsigned bytes_per_pixel = (bits_per_pixel + 7) / 8;
    
        return with_data(pixel_format, data.data(), static_cast<unsigned>(data.size() / bytes_per_pixel));
    }
    

    It attempts to get the bits per pixel for the given pixel format; however, an empty palette has SAIL_PIXEL_FORMAT_UNKNOWN. This causes sail_bits_per_pixel to raise an error. Additionally, bits_per_pixel doesn't get initialized, causing undefined behavior (I encountered a SIGFPE crash when the uninitialized variable happened to be zero). Given that the result of this operation isn't used anyway in case of an unknown format, I'd suggest to simply wrap the entire thing in an if condition.

    Here's a fixed version of the function:

    palette& palette::with_data(SailPixelFormat pixel_format, const arbitrary_data &data)
    {
        unsigned color_count = 0;
        
        if (pixel_format != SAIL_PIXEL_FORMAT_UNKNOWN) {
            unsigned bits_per_pixel = 0;
            
            SAIL_TRY_OR_SUPPRESS(sail_bits_per_pixel(pixel_format, &bits_per_pixel));
            
            const unsigned bytes_per_pixel = (bits_per_pixel + 7) / 8;
            color_count = static_cast<unsigned>(data.size() / bytes_per_pixel);
        }
        
        return with_data(pixel_format, data.data(), color_count);
    }
    

    It might also be a good idea to check the other uses of SAIL_TRY_OR_SUPPRESS for similar bugs (especially regarding undefined behavior stemming from uninitialized result variables). I can grep over the code tomorrow if you like, just let me know.

    Thanks a lot! Jonathan

    bug 
    opened by JoniSt 10
  • vcpkg include directories incorrect

    vcpkg include directories incorrect

    It seems that when installing using vcpkg, the headers expect that the include root is in the sail directory, but vcpkg places the includes under sail. To include something in your own project, you need

    #include <sail/sail-c++/sail-c++.h>
    

    but the sail headers includes other sail headers as

    #include <sail-c++/...>
    

    Am I missing something here? Was this project updated since it was set up for vcpkg that caused this?

    opened by shiiion 10
  • png codec doesn't support non indexed grayscale

    png codec doesn't support non indexed grayscale

    basically if I just check formats with sail::codec_info::from_extension("png").write_features().output_pixel_formats() it just gives me this list: 13,14,15,16,31,32,33,34,47,48,49,50,55,56,57,58

    I've tried to write png image from grayscale buffer but didn't actually find an obvious way to do that (apart from converting it to rgb which I'd like to avoid)

    is that intended? or it's something with my build (I just installed it from vcpkg)

    opened by igor-elovikov 9
  • Lua style custom allocators

    Lua style custom allocators

    Tried a search for alloc but that brought up a lot of junk results that didn't match what I was looking for, when lua is first initialised in C it provides the option of setting a custom allocator and user data where the allocator is of the form void * Alloc( void *ud, void *ptr, size_t size, size_t want ) where ud is ignored by the default allocator and only used by a user supplied allocator, this is helpful when multi-threading as I can pass the threads object to the ud parameter which can then communicate the desire for memory to the main thread which handles the allocations instead, avoiding potential collisions when 2 or more threads try to re-allocate memory as they can just all have the same pointer & size reported to them after each re-allocation request is processed, also makes garbage collection easier.

    Does SAIL have something similar? If not I'll have to write my own custom image loading functions, I'd prefer to not do that though as I'm trying to keep my graphic studies to just the graphics and not the formats (only recently learned how to use index buffers and am now trying to learn how to use textures).

    opened by awsdert 8
  • Copying of library contents with GCC's --whole-archive doesn't work, breaks non-shared build

    Copying of library contents with GCC's --whole-archive doesn't work, breaks non-shared build

    Hi again,

    the static build woes on Linux aren't quite over yet, sadly... :cry:

    I just switched to using BUILD_SHARED_LIBS=OFF when I noticed that my build was still using the old (no longer functional) SAIL_STATIC=ON flag. As soon as I did that, my project broke with the following linker errors:

    /usr/bin/ld: /home/jonathan/CLionProjects/vlktest/cmake-build-optimizeddebug/thirdparty/sail/install/lib/libsail-codecs.a(enabled_codecs.c.o):(.data.rel.ro+0x8): undefined reference to `sail_codec_read_seek_next_frame_v6_bmp'
    /usr/bin/ld: /home/jonathan/CLionProjects/vlktest/cmake-build-optimizeddebug/thirdparty/sail/install/lib/libsail-codecs.a(enabled_codecs.c.o):(.data.rel.ro+0x10): undefined reference to `sail_codec_read_frame_v6_bmp'
    /usr/bin/ld: /home/jonathan/CLionProjects/vlktest/cmake-build-optimizeddebug/thirdparty/sail/install/lib/libsail-codecs.a(enabled_codecs.c.o):(.data.rel.ro+0x18): undefined reference to `sail_codec_read_finish_v6_bmp'
    /usr/bin/ld: /home/jonathan/CLionProjects/vlktest/cmake-build-optimizeddebug/thirdparty/sail/install/lib/libsail-codecs.a(enabled_codecs.c.o):(.data.rel.ro+0x20): undefined reference to `sail_codec_write_init_v6_bmp'
    /usr/bin/ld: /home/jonathan/CLionProjects/vlktest/cmake-build-optimizeddebug/thirdparty/sail/install/lib/libsail-codecs.a(enabled_codecs.c.o):(.data.rel.ro+0x28): undefined reference to `sail_codec_write_seek_next_frame_v6_bmp'
    /usr/bin/ld: /home/jonathan/CLionProjects/vlktest/cmake-build-optimizeddebug/thirdparty/sail/install/lib/libsail-codecs.a(enabled_codecs.c.o):(.data.rel.ro+0x30): undefined reference to `sail_codec_write_frame_v6_bmp'
    /usr/bin/ld: /home/jonathan/CLionProjects/vlktest/cmake-build-optimizeddebug/thirdparty/sail/install/lib/libsail-codecs.a(enabled_codecs.c.o):(.data.rel.ro+0x38): undefined reference to `sail_codec_write_finish_v6_bmp'
    /usr/bin/ld: /home/jonathan/CLionProjects/vlktest/cmake-build-optimizeddebug/thirdparty/sail/install/lib/libsail-codecs.a(enabled_codecs.c.o):(.data.rel.ro+0x40): undefined reference to `sail_codec_read_init_v6_jpeg'
    /usr/bin/ld: /home/jonathan/CLionProjects/vlktest/cmake-build-optimizeddebug/thirdparty/sail/install/lib/libsail-codecs.a(enabled_codecs.c.o):(.data.rel.ro+0x48): undefined reference to `sail_codec_read_seek_next_frame_v6_jpeg'
    /usr/bin/ld: /home/jonathan/CLionProjects/vlktest/cmake-build-optimizeddebug/thirdparty/sail/install/lib/libsail-codecs.a(enabled_codecs.c.o):(.data.rel.ro+0x50): undefined reference to `sail_codec_read_frame_v6_jpeg'
    /usr/bin/ld: /home/jonathan/CLionProjects/vlktest/cmake-build-optimizeddebug/thirdparty/sail/install/lib/libsail-codecs.a(enabled_codecs.c.o):(.data.rel.ro+0x58): undefined reference to `sail_codec_read_finish_v6_jpeg'
    /usr/bin/ld: /home/jonathan/CLionProjects/vlktest/cmake-build-optimizeddebug/thirdparty/sail/install/lib/libsail-codecs.a(enabled_codecs.c.o):(.data.rel.ro+0x60): undefined reference to `sail_codec_write_init_v6_jpeg'
    /usr/bin/ld: /home/jonathan/CLionProjects/vlktest/cmake-build-optimizeddebug/thirdparty/sail/install/lib/libsail-codecs.a(enabled_codecs.c.o):(.data.rel.ro+0x68): undefined reference to `sail_codec_write_seek_next_frame_v6_jpeg'
    /usr/bin/ld: /home/jonathan/CLionProjects/vlktest/cmake-build-optimizeddebug/thirdparty/sail/install/lib/libsail-codecs.a(enabled_codecs.c.o):(.data.rel.ro+0x70): undefined reference to `sail_codec_write_frame_v6_jpeg'
    /usr/bin/ld: /home/jonathan/CLionProjects/vlktest/cmake-build-optimizeddebug/thirdparty/sail/install/lib/libsail-codecs.a(enabled_codecs.c.o):(.data.rel.ro+0x78): undefined reference to `sail_codec_write_finish_v6_jpeg'
    /usr/bin/ld: /home/jonathan/CLionProjects/vlktest/cmake-build-optimizeddebug/thirdparty/sail/install/lib/libsail-codecs.a(enabled_codecs.c.o):(.data.rel.ro+0x80): undefined reference to `sail_codec_read_init_v6_png'
    /usr/bin/ld: /home/jonathan/CLionProjects/vlktest/cmake-build-optimizeddebug/thirdparty/sail/install/lib/libsail-codecs.a(enabled_codecs.c.o):(.data.rel.ro+0x88): undefined reference to `sail_codec_read_seek_next_frame_v6_png'
    /usr/bin/ld: /home/jonathan/CLionProjects/vlktest/cmake-build-optimizeddebug/thirdparty/sail/install/lib/libsail-codecs.a(enabled_codecs.c.o):(.data.rel.ro+0x90): undefined reference to `sail_codec_read_frame_v6_png'
    /usr/bin/ld: /home/jonathan/CLionProjects/vlktest/cmake-build-optimizeddebug/thirdparty/sail/install/lib/libsail-codecs.a(enabled_codecs.c.o):(.data.rel.ro+0x98): undefined reference to `sail_codec_read_finish_v6_png'
    /usr/bin/ld: /home/jonathan/CLionProjects/vlktest/cmake-build-optimizeddebug/thirdparty/sail/install/lib/libsail-codecs.a(enabled_codecs.c.o):(.data.rel.ro+0xa0): undefined reference to `sail_codec_write_init_v6_png'
    /usr/bin/ld: /home/jonathan/CLionProjects/vlktest/cmake-build-optimizeddebug/thirdparty/sail/install/lib/libsail-codecs.a(enabled_codecs.c.o):(.data.rel.ro+0xa8): undefined reference to `sail_codec_write_seek_next_frame_v6_png'
    /usr/bin/ld: /home/jonathan/CLionProjects/vlktest/cmake-build-optimizeddebug/thirdparty/sail/install/lib/libsail-codecs.a(enabled_codecs.c.o):(.data.rel.ro+0xb0): undefined reference to `sail_codec_write_frame_v6_png'
    /usr/bin/ld: /home/jonathan/CLionProjects/vlktest/cmake-build-optimizeddebug/thirdparty/sail/install/lib/libsail-codecs.a(enabled_codecs.c.o):(.data.rel.ro+0xb8): undefined reference to `sail_codec_write_finish_v6_png'
    

    I then tried to do another clean build of SAIL with the following CMake command-line: cmake -DBUILD_SHARED_LIBS=OFF -DSAIL_THIRD_PARTY_CODECS_PATH=OFF -DSAIL_ONLY_CODECS="png;jpeg;bmp" ..

    The build of SAIL itself worked; however, the libsail-codecs.a archive doesn't contain any of the codecs' symbols, it just references them:

    [email protected]:~/bigdisk/sail-repo/sail/build/src/sail-codecs-archive$ nm -g libsail-codecs.a 
    
    enabled_codecs.c.o:
                     U sail_codec_read_finish_v6_bmp
                     U sail_codec_read_finish_v6_jpeg
                     U sail_codec_read_finish_v6_png
                     U sail_codec_read_frame_v6_bmp
                     U sail_codec_read_frame_v6_jpeg
                     U sail_codec_read_frame_v6_png
                     U sail_codec_read_init_v6_bmp
                     U sail_codec_read_init_v6_jpeg
                     U sail_codec_read_init_v6_png
                     U sail_codec_read_seek_next_frame_v6_bmp
                     U sail_codec_read_seek_next_frame_v6_jpeg
                     U sail_codec_read_seek_next_frame_v6_png
                     U sail_codec_write_finish_v6_bmp
                     U sail_codec_write_finish_v6_jpeg
                     U sail_codec_write_finish_v6_png
                     U sail_codec_write_frame_v6_bmp
                     U sail_codec_write_frame_v6_jpeg
                     U sail_codec_write_frame_v6_png
                     U sail_codec_write_init_v6_bmp
                     U sail_codec_write_init_v6_jpeg
                     U sail_codec_write_init_v6_png
                     U sail_codec_write_seek_next_frame_v6_bmp
                     U sail_codec_write_seek_next_frame_v6_jpeg
                     U sail_codec_write_seek_next_frame_v6_png
    0000000000000000 D sail_enabled_codecs
    0000000000000020 D sail_enabled_codecs_info
    0000000000000000 D sail_enabled_codecs_layouts
    

    On the other hand, libsail-codecs-objects.a does contain the codecs' symbols.

    Apparently, the GNU linker's --whole-archive option only adds dependencies on all public symbols of the libraries that are being linked against, it does not copy them into the new archive. (It only does the copying when building an executable or shared object, not when building an archive.)

    On the other hand, if I build with BUILD_SHARED_LIBS=ON, the libsail-codecs.a that is produced does contain all the required symbols and works fine with static linking.

    As far as I can tell, it should be possible to just remove the library copying step and always build the combined archive like in the shared library case (by compiling everything directly into sail-codecs). There should be no reason to build the static library in two different ways depending on whether the shared library is built as well or not.

    I did this change on my fork of the repo and it works just fine on Linux (and fixes the problem): https://github.com/JoniSt/sail/tree/remove-library-copying

    Do you think this would break anything? (Or is it intentional that sail-codecs doesn't contain the codecs themselves in a non-shared build? Should I instead link against sail-codecs-objects?)

    Jonathan

    opened by JoniSt 7
  • Notify user code about contexts created in the background

    Notify user code about contexts created in the background

    I'm currently using SAIL in a heavily multithreaded project where I don't know exactly what threads my code (and therefore SAIL) is potentially running on. This means that SAIL will often create new thread-local contexts in the background that my code isn't aware of (and therefore can't clean up with sail_finish).

    I'd really appreciate it if you could add a feature that allows user code to get notified of new contexts created by SAIL. Here's a patch that implements this functionality with a user-settable callback function which gets called by init_context just before context initialization. That way, the user can manipulate the flags of the context and keep track of it so it can be properly cleaned up when it's not needed anymore (i.e. when the thread exits).

    Thanks!

    enhancement 
    opened by JoniSt 7
  • No rule to make target '/lib/libavif.a'

    No rule to make target '/lib/libavif.a'

    Hi,

    I'm trying to use sail + vcpkg + cmake + Ubuntu 20.10 in my application. When I try to build the project I can see this error:

    gmake[2]: *** No rule to make target '/lib/libavif.a', needed by

    and this file is not in the /lib folder. Not sure why it is being searched in this location because this file is in the /build/vcpkg_installed/x64-linux/lib folder.

    When I manually edit this path in "build.make" and "link.txt" I see errors:

    error.txt

    I also tried to add this to my cmake file: set(SAIL_EXCEPT_CODECS "av1;avif" CACHE STRING "Disable the codecs specified in this ';'-separated list.
    A codec specified in this setting remains disabled even if it's also specified in SAIL_ONLY_CODECS.") but it did nothing.

    opened by pawelflisikowski 6
  • SAIL_ERROR_CODEC_NOT_FOUND when installing via vckpkg on windows

    SAIL_ERROR_CODEC_NOT_FOUND when installing via vckpkg on windows

    config.h shows that the codecs should be stored in path "...\vcpkg\packages\sail_x64-windows-static\lib\sail\codecs" However no such folder or file named sail\codecs exists in path "...\vcpkg\packages\sail_x64-windows-static\lib\"

    I am just trying to read a jpg or png file, but I keep getting the codec not found error. I have only tried x64-windows-static and x64-windows versions however.

    bug 
    opened by M0liusX 6
  • CMake build error

    CMake build error

    Hi. I'm want to build SAIL on Arch Linux, but I get this error:

       CMake Error at examples/c/sail-sdl-viewer/CMakeLists.txt:30 (string):
       string sub-command STRIP requires two arguments.
    

    all dependencies are installed

    opened by maksmakuta 3
  • Call to image.with_shallow_pixels will free pixels used in previous call to with_shallow_pixels

    Call to image.with_shallow_pixels will free pixels used in previous call to with_shallow_pixels

    The notes in image-c++.h indicate that, with this function, shallow data is not deleted upon image destruction.

    It's a natural assumption that this would include reuse of the image object.

    (SHA 6250cceea79b7e7218224cb30ffc04ea7c9e4cd9)

    opened by Geof23 3
  • Sail fails to decode some APNGs

    Sail fails to decode some APNGs

    Sail fails to decode Animated PNG files which use a Color Type other than 6 and APNG_BLEND_OP_OVER. This is because png_private_blend_over only supports RGBA, and doesn't check the tRNS chunk. Even if the PNG doesn't have any transparency information, blend_source should be used instead (equivalent to blend_over assuming all pixels are opaque).

    Examples from https://philip.html5.org/tests/apng/tests.html: 8-bit greyscale and alpha, with blending 1-bit palette and alpha, with blending

    const char* filename = "038.png";
    sail_image* image = NULL;
    const sail_codec_info* codec_info = NULL;
    void* state = NULL;
    sail_codec_info_from_extension("png", &codec_info); // SAIL_OK
    sail_start_loading_from_file(filename, codec_info, &state); // SAIL_OK
    sail_load_next_frame(state, &image); // SAIL_OK
    sail_load_next_frame(state, &image); // SAIL_ERROR_UNSUPPORTED_BIT_DEPTH
    

    And here's a 16-bit grayscale+alpha APNG that will incorrectly be blended as if it's 8-bit RGBA: grayanim16

    opened by qbnu 6
  • Inspect libjxl for JPEG XL plugin

    Inspect libjxl for JPEG XL plugin

    Many (most?) distros link libaom against libjxl for butteraugli tuning, and libavif is typically linked against libaom. This means that libjxl is likely already available when building sail.

    opened by Seirdy 0
  • Implement more tests

    Implement more tests

    Ideas:

    • check all codecs have the same layout version
    • check all codecs could be loaded
    • decode/encode with reference data
    • all codecs have RGB and RGBA output
    • mem and file I/O sources output the same data
    enhancement 
    opened by HappySeaFox 0
Releases(v0.9.0-rc2)
  • v0.9.0-rc2(Dec 17, 2022)

    SAIL: Add CodeQL workflow for GitHub code scanning BINDINGS/C++: Add missing sail_variant forward declaration BINDINGS/C++: Include missing common.h for SailCompression BINDINGS/C++: Include missing common.h for SailPixelFormat BINDINGS/C++: Include missing compression_level-c++.h for sail::compression_level BINDINGS/C++: Include missing cstddef BINDINGS/C++: Include missing includes BINDINGS/C++: Include missing manip_common.h for manip options BINDINGS/C++: Include missing stddef COMMON: Added floating point pixel formats COMMON: Include missing includes COMMON: Include missing stddef DOC: Remove LGTM badge DOC: Update description LIBSAIL: Include missing includes LIBSAIL: Include missing stddef PNG: Use snprintf() SAIL: Added missing return SAIL: Remove LGTM config SAIL: Update Linux distro to 22.04 in Travis SAIL: Update comments SAIL: Update links to git SAIL: Update macOS to 12.6 in Travis config SAIL: Use <> brackets in CMake test SAIL: Use Windows.h with _WIN32_WINNT=0x0600

    Source code(tar.gz)
    Source code(zip)
  • v0.9.0-rc1(Sep 14, 2022)

    BINDINGS/C++: Added explicit keyword BINDINGS/C++: Added finish() to image_input and image_output BINDINGS/C++: Added io_memory(arbitrary_data) BINDINGS/C++: Added more constructors to io_memory BINDINGS/C++: Added variant::clear() BINDINGS/C++: Make image_output::next_frame() non-const BINDINGS/C++: Refactor image_input BINDINGS/C++: Refactor image_output BINDINGS/C++: Update comments BMP: Make marker constants as enum CODECS: Remove I/O parameter from codec functions CODECS: Remove parameters checks in codecs COMMON: Make sail_bits_per_pixel() non-defensive COMMON: Make sail_bytes_per_line() non-defensive COMMON: Make sail_print_errno() non-defensive COMMON: Make sail_string_hash() return 0 on empty input COMMON: Remove orientation COMMON: Rename 'flip' functions to 'mirror' DOC: Added X10 X11 XBM specifications EXAMPLES: Support CMake configurations that export SDL2::SDL2 LIBSAIL: Fix indent LIBSAIL: Fixed allocating memory I/O for reading and writing when reading was not allowed PCX: Added missing size of [] SAIL: Added SAIL_ENABLE_CODECS CMake option SAIL: Remove extra quotes SAIL: Rename junior functions to not have image in their names SAIL: Rename loading/saving functions to have from/into in their names TESTS: Added TGA images TESTS: Added X11 XBM image TESTS: Added XBM images TESTS: Added more BMP files TESTS: Detect codec info for loading from memory TESTS: Move images to an upper level TESTS: Rename PNG image TGA: Note on avoiding mirroring XBM: Fixed reading X10 images

    Source code(tar.gz)
    Source code(zip)
  • v0.9.0-pre23(May 4, 2022)

    BINDINGS/C++: Added ostream for common enums [closes #177] BINDINGS/C++: Fixed crash in variant constructor BINDINGS/C++: Remove unnecessary anonymous namespace CODECS: Remove codec-specific .cmake files and move logic into codec-specific CMakeLists.txt COMMON: Added resolution unit serialization COMMON: Remove flip functions as they don't update image orientation correctly (may be will address this in the future) DOC: Added link to Conan recipe SAIL: Rename SAIL_EXCEPT_CODECS to SAIL_DISABLE_CODECS TIFF: Enable all codecs in VCPKG or cross-compilation mode

    Source code(tar.gz)
    Source code(zip)
    sail-0.9.0-portable-msvc-2019-x64-debug.zip(9.24 MB)
    sail-0.9.0-portable-msvc-2019-x64-release.zip(6.19 MB)
    sail-0.9.0-portable-msvc-2022-x64-debug.zip(9.54 MB)
    sail-0.9.0-portable-msvc-2022-x64-release.zip(6.16 MB)
  • v0.9.0-pre22(Apr 22, 2022)

    BINDINGS/C++: Fixed tuple compilation on come old compilers BINDINGS/C++: Rename to_load/save_options() to to_options() BINDINGS/C++: Downgrade to C++11 CODECS: Remove unused 'properties' field from [save-features] CODECS: Rename compression-types to compressions COMMON: Added sail_compression_level COMMON: Fix source_properties -> source_image.properties COMMON: Move tuning field down COMMON: Remove SAIL_CHROMA_SUBSAMPLING_UNSUPPORTED COMMON: Remove SAIL_COMPRESSION_UNSUPPORTED COMMON: Remove references to non-existing read_features.input_pixel_formats COMMON: Rename compression levels fields like level_min -> min_level COMMON: Rename output_pixel_formats to pixel_formats in write features [closes #165] COMMON: Split image properties DOC: Remove examples as outdated DOC: Remove properties from save-features DOC: Update bagdes SAIL: Added CMAKE_POSITION_INDEPENDENT_CODE SAIL: Added SAIL_INSTALL_PDB option SAIL: Added SAIL_THREAD_SAFE compile option [closes #170] SAIL: Advance codecs layout V6 -> V7 as we renamed codec interface functions from 'read' to 'load' TESTS: Rename able-to-load test to can-load TIFF: Added comment to check_c_source_runs() test TIFF: Disable check_c_source_runs() in cross-compiling mode

    Source code(tar.gz)
    Source code(zip)
    sail-0.9.0-portable-msvc-2019-x64-debug.zip(9.19 MB)
    sail-0.9.0-portable-msvc-2019-x64-release.zip(6.18 MB)
    sail-0.9.0-portable-msvc-2022-x64-debug.zip(9.49 MB)
    sail-0.9.0-portable-msvc-2022-x64-release.zip(6.16 MB)
  • v0.9.0-pre21(Apr 6, 2022)

    BINDINGS/C++: Add more ctors BINDINGS/C++: Rename with_ to set_ BINDINGS/C++: Added editable image::meta_data() BINDINGS/C++: Added image::scan_line() BINDINGS/C++: Added more moving methods to image BINDINGS/C++: Added more variant constructors for sail_variant * BINDINGS/C++: Added supported tuning options to read/write features BINDINGS/C++: Make codec options getter to return non-const reference BINDINGS/C++: Remove confusing 'shallow' word in image ctors BINDINGS/C++: Remove image's size and pixels methods from public BINDINGS/C++: Remove image::set_meta_data(sail::meta_data). Use editable image::meta_data() instead BINDINGS/C++: Remove obsolete with_id() from docs BINDINGS/C++: Remove unnecessary explicit deletion of copy/move stuff BINDINGS/C++: Update iccp:copy() to allow empty data BINDINGS/C++: Use const_cast to cast variant specialization parameter COMMON: Added codec tuning options COMMON: Added sail_compare_variants() COMMON: Added sail_hash_map COMMON: Added sail_image.sail_source_image.special_properties [closes #53] COMMON: Added sail_traverse_hash_map_with_user_data COMMON: Added variant set functions COMMON: Added variant_node COMMON: Move IO functions to io_common.h COMMON: Move string_node to sail-common, make it public, and re-implement with the linked list API COMMON: Put variant-related string functions first COMMON: Reimplement meta data nodes with common linked list API COMMON: Remove 'must be destroyed with ...' from docs [closes #156] COMMON: Remove USER variant type in favor of DATA COMMON: Remove forward declaration of non-existent sail_pixel_formats_mapping_node COMMON: Remove known/unknown functions from meta data COMMON: Remove sail_alloc_variant_from_xxx functions COMMON: Remove sail_read_options_from_features() as read options now needs to be explicitly allocated because of added tuning COMMON: Remove unnecessary forward declaration of sail_meta_data_node COMMON: Remove write_features.properties [closes #155] COMMON: Rename 'io_options' to 'options' [closes #154] COMMON: Rename 'stolen' to 'adopted' COMMON: Rename sail_compare_variants() to sail_equal_variants() COMMON: Rename sail_io_contents_to_data() to sail_alloc_data_from_io_contents() DOC: Delete TODO DOC: Re-make the formats table with HTML EXAMPLES: Added -v to 'sail list' command EXAMPLES: Added support of PNG filters EXAMPLES: Added tuning example for the Qt/C API example JPEG: Added tuning options LIBSAIL: Reimplement codec_bundle_node_private with the linked list API [closes #158] PNG: Add support of filters via tuning options PNG: Support writing grayscale images [closes #163] QOI: Fixed potential memory leak on error SAIL: Added sail_check_alignas() SAIL: Enable ASAN for all libs (with SAIL_DEV) SAIL: Enable ASAN for external tests and SAIL_DEV=ON SAIL: Update macOS 11.3 -> 11.6 in Travis TESTS: Added more /bindings/c++ prefixes TESTS: Added overwrite test for sail_hash_map TESTS: Added test to put and erase many items in a hash map TESTS: Added variant test TESTS: Fixed main() return type to be int TESTS: Improve read_options and write_options tests with modified tuning values TESTS: Reduce number of keys for hash map test to 2500 TESTS: Rename comparators to avoid conflicts TESTS: Test copying hash maps TGA: Fix alignment TGA: Fixed allocating meta data WEBP: Fix alignment XBM: Added XBM image format

    Source code(tar.gz)
    Source code(zip)
    sail-0.9.0-portable-msvc-2019-x64-debug.zip(9.18 MB)
    sail-0.9.0-portable-msvc-2019-x64-release.zip(6.17 MB)
    sail-0.9.0-portable-msvc-2022-x64-debug.zip(9.50 MB)
    sail-0.9.0-portable-msvc-2022-x64-release.zip(6.15 MB)
  • v0.9.0-pre20(Feb 7, 2022)

    BINDINGS/C++: Added comments on io[file/mem]::codec_info() BINDINGS/C++: Added const to some pimpls BINDINGS/C++: Added image_output::written() instead of stop(&written) BINDINGS/C++: Added io_base base class for I/O objects and io_file BINDINGS/C++: Added io_memory BINDINGS/C++: Added more overloaded methods in image_input and image_output BINDINGS/C++: Added sail::abstract_io instead of sail::io BINDINGS/C++: Added sail::io_file() BINDINGS/C++: Detect codec info with I/O-specific method BINDINGS/C++: Include <stdexcept> instead of <new> BINDINGS/C++: Remove 'struct' from sail_io usage to avoid MSVC 2017 error BINDINGS/C++: Remove unnecessary error.h include BINDINGS/C++: Rename file_pimpl to io_file_pimpl BINDINGS/C++: Rename sail_io() to sail_io_c() BINDINGS/C++: Sort headers in sail-c++.h BINDINGS/C++: Update comments on image constructors CODECS: Export dependent OBJECT libraries for clients as CMake doesn't do that (for static builds) CODECS: Fix linking in static mode CODECS: Remove sail-codecs-objects as it's not needed anymore. enabled_codecs.c explicitly refers to every codec function and compilers don't throw them away anymore COMMON: Rename 'mem' to 'memory' DOC: Update license years LIBSAIL: Make file and memory I/O functions visible LIBSAIL: Rename _mem to _memory and _write to _read_write LIBSAIL: Rename sail_read_file, sail_read_memory, sail_write_file, sail_write_memory LIBSAIL: Reorder read/write callbacks SAIL: Added RENAME parameter for sail_install_pdb() to allow sail.exe.pdb SAIL: Added combined build for Linux in Travis SAIL: Added external tests in Travis SAIL: Added external tests to make sure external linking works fine SAIL: Added static build in Travis SAIL: Added support of MSVC 2022 to make-portable.sh.in SAIL: Check for -fsanitize=address SAIL: Clarify more on object libraries in static mode in sail_codec.cmake SAIL: Hardcode sail.exe pdb file name to avoid failures on Travis Windows SAIL: Print CMake version SAIL: Print codecs separated by spaces instead of commas SAIL: Remove SAIL_STATIC CMake variable in favor of BUILD_SHARED_LIBS SAIL: Remove Windows static build in Travis as it doesn't support external tests SAIL: Rename local variable to have no SAIL_ prefix SAIL: Split Linux builds into shared and static in Travis WEBP: Use find_library to find dependencies in static builds as Webp doesn't distribute CMake configs by default

    Source code(tar.gz)
    Source code(zip)
    sail-0.9.0-portable-msvc-2019-x64-debug.zip(9.00 MB)
    sail-0.9.0-portable-msvc-2019-x64-release.zip(6.15 MB)
    sail-0.9.0-portable-msvc-2022-x64-debug.zip(9.27 MB)
    sail-0.9.0-portable-msvc-2022-x64-release.zip(6.13 MB)
  • v0.9.0-pre19(Dec 20, 2021)

    BINDINGS/C++: Added comment on C4251 BINDINGS/C++: Use unique_ptr COMMON: Added more BPP16 RGB[X] pixel formats COMMON: Added sail_io_contents_to_data() and sail_io_contents_into_data() COMMON: Make sail_now() return 0 on error, not SAIL_OK EXAMPLES: Fixed using bytes per line (ignored previously) ICO: Added ICO image format LIBSAIL: Make codec priorities as enum PCX: Added PCX image format QOI: Added QOI image format (https://phoboslab.org/log/2021/11/qoi-fast-lossless-image-compression) SAIL: Install licenses of third-party components (standalone bundle only) SAIL: Move icons to every codec directory SAIL: Run ldconfig in Travis only on Linux SAIL: Run sail --version on Travis to make sure the binary is functional (no missing dependencies etc.) SAIL: Update benchmarks

    Source code(tar.gz)
    Source code(zip)
    sail-0.9.0-portable-msvc-2019-x64-debug.zip(8.75 MB)
    sail-0.9.0-portable-msvc-2019-x64-release.zip(6.13 MB)
    sail-0.9.0-portable-msvc-2022-x64-debug.zip(8.96 MB)
    sail-0.9.0-portable-msvc-2022-x64-release.zip(6.11 MB)
  • v0.9.0-pre18(Oct 24, 2021)

    BINDINGS/C++: Added new sail::palette(pixel_format, data) constructor BINDINGS/C++: Added new sail::resolution constructor BINDINGS/C++: Added new palette::palette(pixel_format, data, color_count) constructor BINDINGS/C++: Fixed copying invalid palette BINDINGS/C++: Fixed image::image(std::string_view) not allocating pimpl BINDINGS/C++: Make with() builders destructive even when the input is invalid BINDINGS/C++: Simplify with_data() overload in iccp CODECS: Fix using release/debug dependencies for static builds CODECS: Use generator expression to append to INTERFACE_LINK_LIBRARIES COMMON: Fixed memory leak in copying palette EXAMPLES: Display only the first image info EXTRA: Added resvg EXTRA: Fix linking to ZSTD and JBIG in TIFF in Debug builds EXTRA: Install Rust and cargo instead of using portable version EXTRA: Repack resvg as tar.gz EXTRA: Specify build type Release/Debug in command line EXTRA: Unpack perl quietly JPEG2000: Don't use extra void *ptr to malloc JPEG2000: Remove io.h inclusion JPEG2000: Use jas_stream_memopen() instead of jas_stream_memopen2() LIBSAIL: Added (void) to intentionally ignore return value LIBSAIL: Search for file extension in file name component only PNG: Print trace instead of error when no gamma is present #127 SAIL: Added missing include for atoi() SAIL: Added script to build portable versions automatically SAIL: Convert icons to PNG SAIL: Fixed configuring SDL example SAIL: Install icons per codec SAIL: Merge sail-convert and sail-probe into a single 'sail' tool SAIL: Quote test name to allow extra characters in its name as per the doc SAIL: Update help message in sail utility SVG: Added SVG reader TESTS: Added more sail::iccp and sail::palette tests TESTS: Added test to load images in C++ TESTS: Remove unused includes TESTS: Test copying invalid sail::iccp and sail::palette WAL: Added WAL codec and icon WEBP: Added missing NAMES for find_library()

    Source code(tar.gz)
    Source code(zip)
    sail-0.9.0-portable-msvc-2019-x64-debug.zip(8.14 MB)
    sail-0.9.0-portable-msvc-2019-x64-release.zip(6.09 MB)
  • v0.9.0-pre17(Oct 6, 2021)

    AVIF: Fixed library name for static vcpkg BINDINGS/C++: Added image::with_meta_data() overload BINDINGS/C++: Cleanup headers BINDINGS/C++: Make moving operators noexcept BINDINGS/C++: Print 'NULL pointer has been passed' with TRACE level BINDINGS/C++: with_background() in conversion_options sets two colors CODECS: Added priorities CODECS: Advance codec layout version to 6 CODECS: Fill compression of source images CODECS: Remove seek_next_pass codec function and interlaced-passes parameter COMMON: Added AV1 compression COMMON: Added SAIL_IMAGE_PROPERTY_FLIPPED_HORIZONTALLY COMMON: Added SAIL_META_DATA_ID COMMON: Added SAIL_META_DATA_SOFTWARE_VERSION, SAIL_META_DATA_TIME_CONSUMED, SAIL_META_DATA_JOB COMMON: Added image flipping functions COMMON: Added image gamma COMMON: Remove SAIL_IO_OPTION_INTERLACED from default read and write options DOC: Added priority description EXTRA: Added jasper GIF: Treat extension length as unsigned JPEG2000: Added JPEG2000 (reading) JPEG: Save image gamma LIBSAIL-MANIP: Use size_t instead of unsigned LIBSAIL: Fixed error on enumerating codecs PNG: Fixed memory leak in hex_string_to_meta_data_node() PNG: Save and load image gamma SAIL: Added release/debug prefix in make-portable.sh TGA: Added TGA (reading) WEBP: Fixed seeking WEBP: Fixed library name for static vcpkg

    Source code(tar.gz)
    Source code(zip)
    sail-0.9.0-portable-msvc-2019-x64-debug.zip(7.27 MB)
    sail-0.9.0-portable-msvc-2019-x64-release.zip(5.16 MB)
  • v0.9.0-pre16(Sep 8, 2021)

    COMMON: Fixed memory leak in sail_copy_meta_data_node() COMMON: Remove redundant SAIL_CHECK_XXX_NULL_PTR macro COMMON: Update error macro docs DOC: Update docs on SAIL_THIRD_PARTY_CODECS with ';' GIF: Fixed memory leak in saving meta data LIBSAIL: Allow multiple ';'-separated paths in SAIL_THIRD_PARTY_CODECS_PATH #108 LIBSAIL: Improve stability of split_into_string_node_chain() SAIL: Added target name in ASAN enabled message SAIL: Rename SAIL_THIRD_PARTY_CODECS macro to SAIL_THIRD_PARTY_CODECS_PATH

    Source code(tar.gz)
    Source code(zip)
    sail-0.9.0-portable-msvc-2019-x64.zip(5.03 MB)
  • v0.9.0-pre15(Aug 24, 2021)

    BINDINGS/C++: Added image::load() and image::save() BINDINGS/C++: Added minimal tests for read_options and write_options just to make sure they don't crash BINDINGS/C++: Avoid name clashes BINDINGS/C++: Enable /EHsc with MSVC BINDINGS/C++: Rename read() to load() in image_input. Rename write() to save() in image_output COMMON: Added JPEG-XL compression COMMON: Added JPEG-XR compression COMMON: Added SAIL_LIKELY and SAIL_UNLIKEY macro. Moved compiler-specific code into compiler_specifics.h COMMON: Added function to copy only a substring into a meta data node COMMON: Define ENABLE_VIRTUAL_TERMINAL_PROCESSING if it's not defined COMMON: Move serialize utils from utils.h to common_serialize.h COMMON: Re-arrange 'SAIL_THREAD_LOCAL static' to 'static SAIL_THREAD_LOCAL' COMMON: Remove _HEX_ meta data keys COMMON: Rename JPEG2000 to JPEG-2000 COMMON: Rename MULTI-FRAME to MULTI-PAGED COMMON: Rename sail_alloc_buffer... to sail_alloc_data... COMMON: Rename sail_alloc_data_from_file_contents() to sail_file_contents_to_data() COMMON: Use _MSC_VER instead of SAIL_WIN32 to enable _s() functions DOC: Added LGTM shield DOC: Added codec info file format description DOC: Added macOS 11 in BUILDING DOC: Fix docs after renaming image_reader to image_input DOC: Remove sail_finish() from examples EXTRA: Added libwebp EXTRA: Added libwebpdemux EXTRA: Update aom to 3.1.2 JPEG: Fixed memory corruption in fetching ICCP LIBSAIL: Added SAIL_THIRD_PARTY_CODECS. Renamed SAIL_MY_CODECS_PATH to SAIL_THIRD_PARTY_CODECS_PATH LIBSAIL: Added sail_call_once() LIBSAIL: Added sail_init() with default flags LIBSAIL: Check codecs don't allocate pixels LIBSAIL: Guard context with mutexes LIBSAIL: Make INIH functions hidden LIBSAIL: Make global_context static LIBSAIL: Move _XOPEN_SOURCE definition to sail_enable_xopen_source LIBSAIL: Move sail_string_node alloc/destroy functions into string_node_private.h LIBSAIL: Probe files by extensions first LIBSAIL: Refactor context allocation functions LIBSAIL: Use 0x%X to print GetLastError() PNG: Fix potential memory corruption in saving EXIF PNG: Fix skipping a hidden frame in APNG when some image properties were left default, delay in particular PNG: Write EXIF with png_set_exif_1() and raw profiles SAIL: Added script to make portable packages on Windows with MSVC SAIL: Build in debug mode in Travis SAIL: Cache built extra libs on Windows in Travis SAIL: Call vital commands with fail_on_error() to test their return values SAIL: Fix duplicating ENABLED_CODECS and empty DISABLED_CODECS #103 SAIL: Remove macOS 10.15 and Ubuntu 18.04 from Travis to save some Travis credits TESTS: Added PRIVATE keyword for linking tests TESTS: Enable ASAN on tests TIFF: Added JPEG-XL compression WEBP: Added WEBP reading support

    Source code(tar.gz)
    Source code(zip)
    sail-0.9.0-portable-msvc-2019-x64.zip(5.03 MB)
  • v0.9.0-pre14(Jul 20, 2021)

    AVIF: Added AVIF image format BINDINGS/C++: Added more consts BINDINGS/C++: Added more image() constructors BINDINGS/C++: Avoid starting conflicting reading and writing operations BINDINGS/C++: Refactor image_reader and image_writer BINDINGS/C++: Update docs COMMON: Added TRACE log level COMMON: Added YUV pixel formats COMMON: Added chroma_subsampling in source_image COMMON: Move memory allocation functions into memory.h COMMON: Remove EXIF codec feature COMMON: Remove animated property. Use delay instead COMMON: Remove redundant examples COMMON: Update 'A structure' -> specific structures names DOC: Added note on brew and updated 'brew install' command with new prefix EXTRA: Update libs GIF: Remove redundant check for NULL after malloc LIBSAIL-MANIP: Fixed assigning YCbCr pixels from uint16 values LIBSAIL: Added ?? pattern support in magic numbers LIBSAIL: Added missing extern LIBSAIL: Avoid dlsym in combined mode LIBSAIL: Fix signed/unsigned mismatch LIBSAIL: Fixed sscanf argument to use & LIBSAIL: Make codecs info as an exported variable to avoid dlopen/dlsym LIBSAIL: Moved functions pointers to v5_pointers.h PNG: Allocate text lines in heap SAIL: Added macOS 11.3 in Travis SAIL: Fix Debian control installation rules SAIL: Fix SAIL non-VCPKG build with SAIL_COMBINE_CODECS=ON SAIL: Install sail-codecs CMake configs in a separate directory SAIL: Remove macOS 10.14 from Travis to save some Travis credits TESTS: Avoid side effects in munit_assert() TESTS: Fix linking order in static mode TESTS: Fixed minor memory leak in sail-dump TIFF: Use uint32_t instead of deprecated uint32 from tifflib

    Source code(tar.gz)
    Source code(zip)
    sail-0.9.0-portable-msvc-2019-x64.zip(4.78 MB)
  • v0.9.0-pre13(May 18, 2021)

    Major update: reading functions now output pixels as close as possible to the source

    BINDINGS/C++: Added image::convert() BINDINGS/C++: Added image::convert_to() BINDINGS/C++: Added image::convert_to() with options BINDINGS/C++: Added image::is_indexed() image::is_grayscale() BINDINGS/C++: Added more image::convert() overloads BINDINGS/C++: Added sail::conversion_options() BINDINGS/C++: Check pixel format to be != unknown in image::is_valid() BINDINGS/C++: Check pixel format to be != unknown in palette::is_valid() BINDINGS/C++: Fixed potential memory leak BINDINGS/C++: to_sail_xxx methods now allocate data in heap BMP: Fixed reading partial palette CODECS: Added more error messages COMMON: Added LUV pixel formats COMMON: Added SAIL_CHECK_CONVERSION_OPTIONS_PTR COMMON: Added SAIL_ERROR_INVALID_PIXEL_FORMAT COMMON: Added SAIL_IO_OPTION_CLOSE_TO_SOURCE COMMON: Added more pixel format comparing functions COMMON: Added more pixel typedefs COMMON: Added sail_copy_image_skeleton() COMMON: Added sail_is_indexed() sail_is_grayscale() COMMON: Fixed bytes-per-line test COMMON: Implement CHECK functionality as functions, not macros COMMON: Implement SAIL_TRY_OR_CLEANUP through SAIL_TRY_OR_EXECUTE COMMON: to/from now return strings and actual converted values instead of sail_status_t EXAMPLES: Remove deep-diver demos EXAMPLES: v4.h -> v5.h JPEG: Add ext output pixel formats test JPEG: Fixed supported pixel formats for writing JPEG: Refactor bytes_per_line calculation JPEG: Remove obsolete comment LIBSAIL-MANIP: Added pixel format conversion functions PNG: Added ifdef PNG_tRNS_SUPPORTED PNG: Fixed reading 16-bit gray+alpha images PNG: Support indexed images with transparency SAIL: Added all headers into add_library() calls TESTS: Added bytes-per-line TESTS: Added compare-pixel-sizes TESTS: Added include guards and SOVERSION=1 in sail-comparators TESTS: Added sail_closest_pixel_format() tests TESTS: Fix compiling munit with C11 TESTS: Implemented sail-dump parser and printer TESTS: Use munit_assert_memory_equal

    Source code(tar.gz)
    Source code(zip)
  • v0.9.0-pre12(Mar 20, 2021)

    BINDINGS/C++: Fixed crash with vcpkg BINDINGS/C++: Switch to C++17 BINDINGS/C++: Added more utility functions BINDINGS/C++: Don't copy invalid palette BINDINGS/C++: Fixed initializing sail_io BINDINGS/C++: Use string_view BINDINGS/C++: [closes #51] Fix assigning shallow pixels BMP: Add BMP codec COMMON: Added sail_alloc_palette_for_data() COMMON: Added sail_alloc_palette_from_data() COMMON: Added sail_file_size() COMMON: Added sail_read_file_contents() and sail_alloc_buffer_from_file_contents() COMMON: Don't alter pointers on error COMMON: Make resolution values double COMMON: Refactor C examples COMMON: Refactor meta data nodes COMMON: Split read/write I/O functions into tolerant/strict variants DOC: Update FORMATS EXAMPLES: Fix SDL example GIF: Added missing include GIF: codec.info cleanup LIBSAIL: Allow empty compressions when write features is 0 LIBSAIL: More detailed error messages LIBSAIL: Print 'Enumerated codecs:' only when codecs are found LIBSAIL: Update error message SAIL: Added OSX 11 in Travis SAIL: Fixed some CppCheck warnings SAIL: Remove unused Debian-specific code SAIL: Rename HAVE_ macro to SAIL_HAVE_ SAIL: Test for _Thread_local SAIL: Update extra/ to use standard .lib names for bundled libs TESTS: Added allocation functions test TESTS: Added basic read/write options test TESTS: Added iccp test TESTS: Added io-produce-same-images test TESTS: Added meta-data-node test TESTS: Added palette test TIFF: Check TIFF compressions in cmake (except for vcpkg) TIFF: Hardcode write compressions for vcpkg (due to check_c_source_runs() peculiarity) TIFF: Fixed checking for some compressions like PIXARLOG

    Source code(tar.gz)
    Source code(zip)
  • v0.9.0-pre11(Dec 18, 2020)

    SAIL: Added VCPKG port on Windows, Linux, macOS. Install with vcpkg install sail SAIL: Added static compilation support with -DSAIL_STATIC=ON SAIL: Added option to combine all codecs into a single library with -DSAIL_COMBINE_CODECS=ON SAIL: Enable CMAKE_ENABLE_EXPORTS on UNIX with static builds to enable dlsym SAIL: Install our bundled libs if they exist and when VCPKG is not used SAIL: Remove INNO setup support. VCPKG is recommended instead SAIL: Remove git depth in the travis file to avoid sporadic build errors SAIL: Remove libraries detection with pkg-config. Always use CMake SAIL: Update travis to use CMAKE_PREFIX_PATH instead of pkg-config COMMON: Include missing config.h CODECS: Rename codecs to have -codecs prefix CODECS: Rename interface functions to have _codec suffix CODECS: Rename private functions to have codec_private_ prefix LIBSAIL: Always search DLLs in the sail.dll location so custom codecs can hold dependencies there LIBSAIL: Don't fail when no codecs were found. Print a warning instead LIBSAIL: Refactor loading code LIBSAIL: Remove sail_codecs_path() when SAIL_COMBINE_CODECS is defined LIBSAIL: Resolve codecs symbols in the same module to make static build finally work LIBSAIL: Use a 'whole archive' option JPEG: Support non-turbo jpeg EXAMPLES: Fix SDL example to be compatible with VCPKG EXAMPLES: Use PRIVATE in sail_enable_asan DOC: Added -DCMAKE_BUILD_TYPE=Release DOC: Added LUbuntu 20.04 DOC: Remove pkg-config DOC: Reorganize sections DOC: Update FAQ DOC: Update README DOC: Update SAIL installation mode DOC: Update docs with static build DOC: Update terminology

    Source code(tar.gz)
    Source code(zip)
  • v0.9.0-pre10(Dec 4, 2020)

    • BINDINGS/C++: Added missing include
    • CODECS: Rename files to sail- to avoid conflicts with DLLs like tiff.dll
    • COMMON: Added sail_set_logger()
    • COMMON: Always print file and line in log messages, not only when SAIL_DEV is ON
    • COMMON: Print error code on error
    • COMMON: Refactor error macros
    • COMMON: Try to silence clang in empty while()
    • COMMON: Use more specific macros
    • COMMON: Use stat() on Windows too
    • DOC: Added CImg
    • DOC: Added EXAMPLES to the top bar
    • DOC: Added benchmarks
    • DOC: Added doc on SAIL_VCPKG
    • DOC: Added measured time
    • DOC: Added note on Intel IPP
    • DOC: Added note on VCPKG
    • DOC: Move building steps into a separate md file
    • DOC: Remove 'damn' words :)
    • DOC: Remove date
    • DOC: Removed Support
    • DOC: Reword description
    • DOC: Reword improvements
    • DOC: Update description
    • DOC: Update differences
    • DOC: Update image links
    • DOC: Update image sizes
    • DOC: Update notes on DLL search paths
    • EXAMPLES: Fix SDL example with VCPKG
    • EXTRA: Migrate to zlib-ng
    • LIBSAIL: Add sail.dll location to the DLL search path
    • LIBSAIL: Added INI_ALLOW_INLINE_COMMENTS=0 and INI_ALLOW_MULTILINE=0
    • LIBSAIL: Avoid dangling pointer
    • LIBSAIL: Bring the old implementation of strncpy0 back is it's much faster
    • LIBSAIL: Fixed a failure in sail_read_mem
    • LIBSAIL: Fixed adding sail.dll location to the DLL search path
    • LIBSAIL: Load codecs from \sail\codecs on VCPKG
    • LIBSAIL: Refactor if/else
    • LIBSAIL: Simplify functions
    • LIBSAIL: Update INIH to version 52
    • LIBSAIL: Wrap Windows-specific code
    • SAIL: Added VCPKG support
    • SAIL: Added SAIL_BUILD_EXAMPLES option
    • SAIL: Added SAIL_BUILD_TESTS option
    • SAIL: Added comments
    • SAIL: Allow VCPKG on Windows only
    • SAIL: Disable 'lib' siffixes back
    • SAIL: Make C/C++ standards a requirement
    • SAIL: Move thread-local definition to config.h
    • SAIL: Rename cmake file
    • SAIL: Reorder dirs layout
    • SAIL: Set SAIL_VCPKG to ON when SAIL_VCPKG_PORT is ON
    • SAIL: Update to 0.9.0-pre10
    • SAIL: WIP in VCPKG support
    • GIF: Code cleanup. Don't fail on broken (NULL) extensions on malformed files
    • PNG: Allocate a temp string only when the image is APNG
    • TIFF: Added SOURCE pixel format
    Source code(tar.gz)
    Source code(zip)
  • v0.9.0-pre9(Oct 31, 2020)

    • BINDINGS/C++: Added moving ctors
    • BINDINGS/C++: Added sail::meta_data
    • BINDINGS/C++: Fixed crash on nullptr to std::string conversion
    • BINDINGS/C++: Fixed functions names
    • BINDINGS/C++: Fixed read_options copy ctor
    • BINDINGS/C++: Initialize sail_io fields
    • BINDINGS/C++: Move some ctors in read/write options to a private section
    • BINDINGS/C++: Remove unnecessary forward declarations
    • CODECS: Added GIF
    • COMMON: Added 'URL' meta data key
    • COMMON: Added EXIF meta data key
    • COMMON: Added SAIL_CHECK_DATA_PTR
    • COMMON: Added SailMetaInfo
    • COMMON: Added UNKNOWN meta data key into switch
    • COMMON: Added more error codes
    • COMMON: Fix Coverity Scan warning on continuing loop on error
    • COMMON: Fix Coverity Scan warning on dead code in switch/case
    • COMMON: Fix Coverity Scan warning on missing va_end
    • COMMON: Make interlaced_passes 1 by default
    • COMMON: Make meta data nodes to contain binary data as well
    • COMMON: Removed resolution meta data keys as they're a part of sail_resolution now
    • COMMON: Rename 'meta info' to 'meta data'
    • COMMON: Rename EXIF, IPTC, and XMP keys to HEX_
    • COMMON: Rename X/Y resolution meta info enumerators
    • COMMON: Split string and binary meta data values
    • COMMON: Update signatures of memory allocation functions sail_malloc/sail_calloc/sail_realloc
    • DOC: Added FORMATS.md
    • EXAMPLES: Added 'current frame' label in advanced demos
    • EXAMPLES: Added Stop button in advanced demos
    • EXAMPLES: Fix sail-probe
    • EXAMPLES: Fixed compilation issue with SDL2 on Mac
    • JPEG: Move the meta info saving code into a helper
    • LIBSAIL: Added key_unknown
    • LIBSAIL: Fix Coverity Scan warning on printf format
    • LIBSAIL: Fix Coverity Scan warning on using freed pointer
    • LIBSAIL: Load custom codecs from SAIL_MY_CODECS_PATH
    • PNG: Use hardcoded meta data keys for EXIF, IPTC, and XMP tags
    • SAIL: Added CMake development configs
    • SAIL: Append to ENV{PKG_CONFIG_PATH} instead of overwriting it
    • SAIL: Enable PCH on CMake >= 3.16
    • SAIL: Enable _POSIX_C_SOURCE as a compiler definition in CMake
    • SAIL: Fix setting PKG_CONFIG_PATH on Windows
    • SAIL: Include 'jobs' to allow pkg-config find the path to jpeg-turbo
    • SAIL: Include src directories only in build time
    • SAIL: Increase the magic buffer size 10 -> 16 bytes
    • SAIL: Install cmake configs on Debian
    • SAIL: Limit the git clone depth to 1 in travis
    • SAIL: Make the travis badge fetch master builds
    • SAIL: Move context-related functions into context_private.c
    • SAIL: Preserve the old CMAKE_MODULE_PATH
    • SAIL: Remove SDL2 pkg-config path as it's unused
    • SAIL: Simplify list(APPEND) constructions
    • SAIL: Split sail.c into separate files
    • TESTS: Added meta data integrity testing
    • TESTS: Fixed enum type
    • TIFF: Set a string to NULL
    Source code(tar.gz)
    Source code(zip)
    sail-setup-0.9.0-pre9.exe(14.75 MB)
  • v0.9.0-pre8(Sep 30, 2020)

    • SAIL: Use MSVC 2019 to build setup on Windows
    • SAIL: Added libtiff-dev in Debian rules
    • SAIL: Enable more warnings with clang
    • SAIL: Enable undefined linker errors with Clang
    • SAIL: Make pkg-config to search our own build root under extra on all platforms
    • SAIL: Move plugins' dependencies into plugins' projects out of public scope
    • SAIL: Print C, CXX, and linker flags in cmake output
    • SAIL: Rename 'plugin' to 'codec'
    • SAIL: Update comments
    • SAIL: Update extra repository to the latest version
    • SAIL: Use cmake string(append) to modify CFLAGS
    • SAIL: Use extra libs as DLLs
    • COMMON: Added sail_memdup
    • COMMON: Introduce image resolution
    • COMMON: Introduce unique I/O ids so we can distinguish between I/O classes like file and memory
    • COMMON: Rename ICCP allocating functions (with_data -> from_data)
    • COMMON: Rename SAIL_ERROR_UNSUPPORTED_COMPRESSION_TYPE to SAIL_ERROR_UNSUPPORTED_COMPRESSION
    • LIBSAIL: Added System32 to the library search path to fix loading codecs with extra redist dependencies
    • LIBSAIL: Check if we can actually write the requested compression before passing it into a plugin
    • LIBSAIL: Move a private function into the module where it's actually used
    • LIBSAIL: Print more errors on SAIL_ERROR_UNSUPPORTED_PIXEL_FORMAT
    • LIBSAIL: Remove unnecessary SAIL_EXPORT
    • CODECS: Don't store invalid resolution
    • CODECS: Rename .codec.info files to .codec.info.in
    • DIST: Added 'View README Online' into the Windows installer
    • DIST: Added VC redist into the Windows installer
    • DOC: Added programming language to the README header
    • DOC: Simplify the formats table in README
    • EXAMPLES: Enable ASAN with Clang
    • EXAMPLES: Update sail-probe version to 1.2.0
    • JPEG: Read and write resolution information
    • PNG: Fixed compilation warning
    • PNG: Read and write resolution information
    • PNG: Simplify blending functions
    • TIFF: Enable ZSTD
    • TIFF: Fixed target naming for HAVE_TIFF_41
    • TIFF: Read and write resolution information
    • TIFF: Remove unused compressions
    • BINDINGS/C++: Make more methods in codec_info overloaded
    • BINDINGS/C++: Remove unnecessary friends
    Source code(tar.gz)
    Source code(zip)
    sail-setup-0.9.0-pre8.msvc2019.x64.exe(14.73 MB)
  • v0.9.0-pre7(Aug 20, 2020)

    • COMMON: Make more fields unsigned
    • COMMON: Added SAIL_ERROR_UNSUPPORTED_SEEK_WHENCE
    • COMMON: Added missing pixel formats in sail_bits_per_pixel()
    • PLUGINS: Added TIFF file format
    • PLUGINS: Make compression levels double instead of int
    • PLUGINS: Updated the reading function to accept non-const images as we modify their pixels
    • JPEG: Handle other RGB conversions from CMYK
    • JPEG: Added more output pixel formats
    • PNG: Detect if we actually can write the requested output format
    • LIBSAIL: Allocate context implicitly per thread. The public API now doesn't require contexts at all
    • LIBSAIL: Fixed getting the number of bytes written
    • LIBSAIL: Allow reading in I/O writing operations
    • LIBSAIL: Fix manipulating memory I/O source
    • LIBSAIL: Use sail_malloc() more
    • BINDINGS/C++: Fixed copying compressions
    • BINDINGS/C++: Fixed copying image meta entries
    • BINDINGS/C++: Make probe methods overloads
    • EXAMPLES: Print all meta entries in deep-diver demos
    • EXAMPLES: Support older versions of Qt
    Source code(tar.gz)
    Source code(zip)
    sail-setup-0.9.0-pre7.exe(2.04 MB)
  • v0.9.0-pre6(Jul 22, 2020)

    • COMMON: Added more file/dir access utility functions
    • COMMON: sail_image now also holds pixels along with image information
    • PLUGINS: Scanline reading/writing interface has been refactored to read/write entire frames
    • PLUGINS: Renamed preferred_output_pixel_format to default_output_pixel_format
    • PLUGINS: Fixed saving images with default write options
    • JPEG: Fixed crash on stopping unstarted compression
    • JPEG: Fixed saving SOURCE images
    • LIBSAIL: Renamed 'bits' to 'pixels'
    • LIBSAIL: Added junior functions to read/write from/to memory
    • LIBSAIL: Wrapped memory allocation functions so they can be easily re-defined in a single place (no standard mechanism so far)
    • SAIL: macOS HomeBrew package is fully functional

    Special thanks to the OpenNET community for their feedback.

    Source code(tar.gz)
    Source code(zip)
    sail-setup-0.9.0-pre6.exe(1.74 MB)
  • v0.9.0-pre5(Jul 6, 2020)

    • DOC: Added note on plugins search algorithm
    • LIBSAIL: Document how SAIL searches for plugins
    • LIBSAIL: Dynamically build a path to SAIL plugins on Windows
    • COMMON: Added SAIL_TRY_OR_EXECUTE() macro
    • SAIL: Allow selecting a different folder to install SAIL on Windows
    • EXAMPLES: Added note on RGB and RGBA pixels to output in the advanced demos
    • EXAMPLES: Avoid settings pointers to 0 where appropriate
    • DOC: Remove the note on legacy image formats
    • DOC: Reorder the supported platforms list
    • JPEG: Fixed calculating bytes per line for CMYK images
    • JPEG: Fixed setting bytes per line
    • JPEG: Fixed setting image pixel format when the SOURCE pixel format was requested
    • JPEG: Use enum SailPixelFormat instead of just int
    • SAIL: Remove 'leak' ASAN option
    • SAIL: Enabled ASAN with Clang
    • DOC: Note on installation from source on MacOS
    Source code(tar.gz)
    Source code(zip)
    sail-setup-0.9.0-pre5.exe(1.74 MB)
  • v0.9.0-pre4(Jul 5, 2020)

  • v0.9.0-pre3(Jul 2, 2020)

    • Added mechanism to detect image types by magic numbers
    • Removed the SOURCE output pixel format from the list of guaranteed pixels formats to output. Some plugins, like TIFF, cannot output SOURCE pixels
    • Display paletted images in the deep-diver C++ demos
    • Moved source image properties into a separate struct image -> source_image
    • Probing images from memory and custom I/O sources
    • Added a log barrier to filter out log messages under a certain level
    • The PNG plugin is able to save indexed images
    • Added MacOS support
    Source code(tar.gz)
    Source code(zip)
    sail-setup-0.9.0-pre3.exe(1.74 MB)
  • v0.9.0-pre2(Jun 16, 2020)

Owner
Dmitry Baryshev
Dmitry Baryshev
A demonstration of various different techniques for implementing 'threaded code,' a technique used in Forth and in virtual machines like the JVM.

Threaded code is a technique used in the implementation of virtual machines (VMs). It avoids the overhead of calling subroutines repeatedly by 'thread

null 25 Nov 4, 2022
Text utilities, including beam search decoding, tokenizing, and more, built for use in Flashlight.

Flashlight Text: Fast, Lightweight Utilities for Text Quickstart | Installation | Python Documentation | Citing Flashlight Text is a fast, minimal lib

null 31 Dec 15, 2022
PoC tool to coerce Windows hosts to authenticate to other machines via MS-EFSRPC EfsRpcOpenFileRaw or other functions.

PetitPotam PoC tool to coerce Windows hosts to authenticate to other machines via MS-EFSRPC EfsRpcOpenFileRaw or other functions :) The tools use the

Topotam 1.4k Jan 4, 2023
rdtsc x86 instruction to detect virtual machines

rdtsc_detector rdtsc x86 instruction to detect virtual machines What is rdtsc? The Time Stamp Counter (TSC) is a 64-bit register present on all x86 pr

null 4 Apr 29, 2022
A guide that teach you build a custom version of Chrome / Electron on macOS / Windows / Linux that supports hardware / software HEVC decoding.

enable-chromium-hevc-hardware-decoding A guide that teach you build a custom version of Chrome / Electron on macOS / Windows / Linux that supports har

Sta Zhu 778 Jan 1, 2023
C++11 header-only library that offers small vector, small flat map/set/multimap/multiset.

sfl library This is header-only C++11 library that offers several new containers: small_vector small_flat_set small_flat_map small_flat_multiset small

null 21 Dec 14, 2022
Second life for famous JPEGView - fast and tiny viewer/editor for JPEG, BMP, PNG, WEBP, TGA, GIF and TIFF images with a minimalist GUI and base image processing.

JPEGView-Image-Viewer-and-Editor Updated Dec 07 2021. Version 1.1.1.0 has been released. Download link1, link2 added. Second life for famous JPEGView

Ann Hatt 40 Dec 27, 2022
A fast and small port of Zstandard to WASM.

Zstandard WASM A fast and small port of Zstandard to WASM. (Decompress-only for now). Features Fast: Zstandard has been compiled with the -03 flag, so

Fabio Spampinato 13 Nov 9, 2022
dwm is an extremely fast, small, and dynamic window manager for X.

dwm - dynamic window manager dwm is an extremely fast, small, and dynamic window manager for X. My Patches This is in the order that I patched everyth

Christian Chiarulli 32 Dec 23, 2022
A small and fast programming language.

Pocketlang is a small (~3000 semicolons) and fast functional language written in C. It's syntactically similar to Ruby and it can be learned within 15

Thakee Nathees 1.4k Dec 28, 2022
ArkScript is a small, fast, functional and scripting language for C++ projects

ArkScript Documentation Discord server: invite link, to discuss the specification of the language and receive help Modules Nota bene: the project is r

ArkScript 484 Jan 1, 2023
A family of small, fast, and simple bitmap fonts in single-file C headers

Blit A family of small, fast, and simple bitmap fonts in single-file C headers [go to repository] These are not intended as a replacement for fancy us

Andrew Reece 56 Dec 22, 2022
TinyGL: a Small, Free and Fast Subset of OpenGL

TinyGL A major overhaul of Fabrice Bellard's TinyGL to be more useful as a software rasterizer. Now with limited multithreading support Tightly tweake

Jim Huang 42 Dec 30, 2022
The purpose of these streams is to be educational and entertaining for viewers to learn about systems architecture, reverse engineering, software security, etc., and NOT to encourage nor endorse malicious game hacking.

Memestream This repository holds the code that I develop during my live game "modding" ?? sessions. When I stream, I like to speedrun making a success

Stephen Tong 28 Jul 6, 2022
The movements of your RC vehicles are jerky and not smooth? This Arduino device will solve this issue by adding acceleration and deceleration ramps to the PWM signals!

This is an Arduino Pro Mini 3.3V / 8MHz based RC servo ramp / delay generator Features: 4 RC servo PWM inputs and outputs (can be enhanced) Reads the

null 4 Apr 15, 2022
A small, fast, vectorizeable libm

jodiemath a small, fast, vectorizeable libm goals: all functions have absolute or relative error ~= 0.000010 or less, this isn't a fast math library,

null 8 Mar 29, 2022
A small, fast codeforces command line tool for competitive programming.

chainsaw: A Codeforces Commandline Tool chainsaw is a small and faster drop-in replacement for your copy and paste while attending Codeforces contests

Jiawei Wang 41 Dec 8, 2022
The Wren Programming Language. Wren is a small, fast, class-based concurrent scripting language.

Wren is a small, fast, class-based concurrent scripting language Think Smalltalk in a Lua-sized package with a dash of Erlang and wrapped up in a fami

Wren 6.1k Dec 30, 2022
Not related to software bugs and exploits; this repo contains snippets of code that demonstrate some interesting functionality or a handy trick.

Proof-of-Concept Not related to software bugs and exploits; this repo contains snippets of code that demonstrate some interesting functionality or a h

Alisa Esage 32 Nov 19, 2022