Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package jp2a for openSUSE:Factory checked in at 2021-11-20 22:48:05 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/jp2a (Old) and /work/SRC/openSUSE:Factory/.jp2a.new.1895 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "jp2a" Sat Nov 20 22:48:05 2021 rev:4 rq:932683 version:1.1.1 Changes: -------- --- /work/SRC/openSUSE:Factory/jp2a/jp2a.changes 2021-07-18 23:45:21.794854922 +0200 +++ /work/SRC/openSUSE:Factory/.jp2a.new.1895/jp2a.changes 2021-11-20 22:48:31.195764864 +0100 @@ -1,0 +2,6 @@ +Sat Nov 20 20:27:54 UTC 2021 - Sebastian Wagner <[email protected]> + +- Update to version 1.1.1: + - Fix memory corruption crash with very high aspect ratio, e.g. 3000:1 (#9). + +------------------------------------------------------------------- Old: ---- jp2a-1.1.0.tar.gz New: ---- jp2a-1.1.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ jp2a.spec ++++++ --- /var/tmp/diff_new_pack.Ps2lNz/_old 2021-11-20 22:48:31.683763247 +0100 +++ /var/tmp/diff_new_pack.Ps2lNz/_new 2021-11-20 22:48:31.687763234 +0100 @@ -18,7 +18,7 @@ %{!?license: %global license %doc} Name: jp2a -Version: 1.1.0 +Version: 1.1.1 Release: 0 Summary: Converts JPEG images to ASCII License: GPL-2.0-only ++++++ jp2a-1.1.0.tar.gz -> jp2a-1.1.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jp2a-1.1.0/.dockerignore new/jp2a-1.1.1/.dockerignore --- old/jp2a-1.1.0/.dockerignore 1970-01-01 01:00:00.000000000 +0100 +++ new/jp2a-1.1.1/.dockerignore 2021-11-20 20:10:37.000000000 +0100 @@ -0,0 +1,20 @@ +.gitignore +.github +Doxyfile.in +README.md +tests + +aclocal.m4 +autom4te.cache +compile +config.h +config.h.in +config.log +config.status +configure +depcomp +install-sh +Makefile +Makefile.in +missing +stamp-h1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jp2a-1.1.0/.github/workflows/publish-docker-image.yml new/jp2a-1.1.1/.github/workflows/publish-docker-image.yml --- old/jp2a-1.1.0/.github/workflows/publish-docker-image.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/jp2a-1.1.1/.github/workflows/publish-docker-image.yml 2021-11-20 20:10:37.000000000 +0100 @@ -0,0 +1,47 @@ +name: Publish Docker image on Docker Hub + +on: + release: + types: [published] + +jobs: + push_to_registry: + name: Push Docker image to Docker Hub + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v2 + + - name: Log in to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + with: + platforms: all + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v1 + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v3 + with: + images: talinx/jp2a + + - name: Build and push + uses: docker/build-push-action@v2 + with: + builder: ${{ steps.buildx.outputs.name }} + context: . + platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/ppc64le + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + + - name: Image digest + run: echo ${{ steps.docker_build.outputs.digest }} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jp2a-1.1.0/ChangeLog new/jp2a-1.1.1/ChangeLog --- old/jp2a-1.1.0/ChangeLog 2020-10-06 13:45:32.000000000 +0200 +++ new/jp2a-1.1.1/ChangeLog 2021-11-20 20:10:37.000000000 +0100 @@ -1,4 +1,7 @@ -CHANGES SINCE 1.10.0 +CHANGES SINCE 1.1.1 +- Fix images with very high aspect ratio, e.g. 3000:1 + +CHANGES SINCE 1.1.0 - support for PNG images - support for HTML (Living Standard) additionally to XHTML - (optional) support for other character encodings than ASCII diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jp2a-1.1.0/Dockerfile new/jp2a-1.1.1/Dockerfile --- old/jp2a-1.1.0/Dockerfile 1970-01-01 01:00:00.000000000 +0100 +++ new/jp2a-1.1.1/Dockerfile 2021-11-20 20:10:37.000000000 +0100 @@ -0,0 +1,12 @@ +FROM ubuntu as builder +WORKDIR /app +COPY . . +ENV DEBIAN_FRONTEND=noninteractive +RUN apt-get update && apt-get install -y gcc make libjpeg-dev libpng-dev libcurl4-gnutls-dev libncurses5-dev autoconf-archive pkg-config +RUN ./autogen.sh && ./configure && make + +FROM ubuntu +WORKDIR /app +RUN apt-get update && apt-get install -y libc6 libjpeg8 libpng16-16 libcurl3-gnutls libtinfo6 +COPY --from=builder /app/src/jp2a /usr/bin/jp2a +ENTRYPOINT ["jp2a"] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jp2a-1.1.0/README new/jp2a-1.1.1/README --- old/jp2a-1.1.0/README 2020-10-06 13:45:32.000000000 +0200 +++ new/jp2a-1.1.1/README 2021-11-20 20:10:37.000000000 +0100 @@ -95,13 +95,6 @@ make -j install -jp2a depends on jpeglib. In case configure fails beacuse jpeglib is not installed, -it can be built and installed manually. Independent JPEG Group provides a UNIX format -package in tar.gz format which can be downloaded from https://www.ijg.org/. - -jp2a uses libpng for reading PNG images. libpng is available at -http://libpng.org/pub/png/libpng.html - Extract the archive and follow the instructions inside 'install.txt' to build and install it. For a default install, the corresponding `.so` (shared object) files will be present in `/usr/local/lib/` @@ -125,6 +118,23 @@ This will look for `curl-config` in $PATH, but you can specify it directly with `--with-curl-config=PATH` if you need to. +### Runtime dependencies +- [jpeglib](https://www.ijg.org/) or [libjpeg-turbo](https://libjpeg-turbo.org/) +- [libpng](http://libpng.org/pub/png/libpng.html) +- [curl](https://curl.haxx.se/) (optional) +- [ncurses](https://invisible-island.net/ncurses/ncurses.html) (optional) + +### Build dependencies +- make (e.g. [GNU Make](https://www.gnu.org/software/make/)) +- a C compiler like [gcc](https://gcc.gnu.org/) + +If you generate the `configure` script yourself (i.e. run `autoreconf`) you also need these: + +- autotools +- [automake](https://www.gnu.org/software/automake/) +- [autoconf](https://www.gnu.org/software/autoconf/autoconf.html) +- [autoconf-archive](https://www.gnu.org/software/autoconf-archive/) + Windows ------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jp2a-1.1.0/configure.ac new/jp2a-1.1.1/configure.ac --- old/jp2a-1.1.0/configure.ac 2020-10-06 13:45:32.000000000 +0200 +++ new/jp2a-1.1.1/configure.ac 2021-11-20 20:10:37.000000000 +0100 @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.69]) -AC_INIT([jp2a],[1.1.0],[[email protected]], [jp2a], [https://github.com/Talinx/jp2a]) +AC_INIT([jp2a],[1.1.1],[[email protected]], [jp2a], [https://github.com/Talinx/jp2a]) DX_INIT_DOXYGEN([jp2a]) AM_INIT_AUTOMAKE(dist-bzip2 dist-zip) AC_CONFIG_SRCDIR(src/jp2a.c) @@ -32,6 +32,8 @@ AC_CHECK_LIB([jpeg], [jpeg_start_decompress], [LIBS="$LIBS -ljpeg"]) AC_CHECK_LIB([png], [png_create_read_struct], [LIBS="$LIBS -lpng"]) +# jp2a uses isfinite from math.h but that can be implemented as a macro so search for another actual function (floor) instead +AC_SEARCH_LIBS([floor], [m]) if test "x$ac_cv_lib_jpeg_jpeg_start_decompress" != "xyes" ; then AC_MSG_ERROR([I need a working jpeglib; please specify --with-jpeg-lib=PATH or see --help for more explicit options. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jp2a-1.1.0/man/jp2a.1 new/jp2a-1.1.1/man/jp2a.1 --- old/jp2a-1.1.0/man/jp2a.1 2020-10-06 13:45:32.000000000 +0200 +++ new/jp2a-1.1.1/man/jp2a.1 2021-11-20 20:10:37.000000000 +0100 @@ -1,4 +1,4 @@ -.TH jp2a 1 "September 13, 2020" "version 1.1.0" "USER COMMANDS" +.TH jp2a 1 "November 20, 2020" "version 1.1.1" "USER COMMANDS" .SH NAME jp2a \- convert JPEG and PNG images to ASCII .SH SYNOPSIS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jp2a-1.1.0/src/image.c new/jp2a-1.1.1/src/image.c --- old/jp2a-1.1.0/src/image.c 2020-10-06 13:45:32.000000000 +0200 +++ new/jp2a-1.1.1/src/image.c 2021-11-20 20:10:37.000000000 +0100 @@ -693,24 +693,26 @@ aspect_ratio(jpg.output_width, jpg.output_height); - malloc_image(&image); - clear(&image); - if ( verbose ) print_info_jpeg(&jpg); - init_image(&image, jpg.output_width, jpg.output_height); - - while ( jpg.output_scanline < jpg.output_height ) { - jpeg_read_scanlines(&jpg, buffer, 1); - process_scanline_jpeg(&jpg, buffer[0], &image); - if ( verbose ) print_progress((float) (jpg.output_scanline + 1.0f) / (float) jpg.output_height); - } + if ( height != 0 && width != 0 ) { + malloc_image(&image); + clear(&image); + + init_image(&image, jpg.output_width, jpg.output_height); + + while ( jpg.output_scanline < jpg.output_height ) { + jpeg_read_scanlines(&jpg, buffer, 1); + process_scanline_jpeg(&jpg, buffer[0], &image); + if ( verbose ) print_progress((float) (jpg.output_scanline + 1.0f) / (float) jpg.output_height); + } - print_image(&image, fout); + print_image(&image, fout); - free_image(&image); + free_image(&image); + jpeg_finish_decompress(&jpg); + } - jpeg_finish_decompress(&jpg); jpeg_destroy_decompress(&jpg); } @@ -757,72 +759,75 @@ png_set_sig_bytes(png_ptr, number_bytes_to_check); png_read_info(png_ptr, info_ptr); - int width = png_get_image_width(png_ptr, info_ptr); - int height = png_get_image_height(png_ptr, info_ptr); - - aspect_ratio(width, height); + int png_width = png_get_image_width(png_ptr, info_ptr); + int png_height = png_get_image_height(png_ptr, info_ptr); - malloc_image(&image); - clear(&image); + aspect_ratio(png_width, png_height); if ( verbose ) print_info_png(png_ptr, info_ptr); - // peform transformations (after printing the info): - if ( png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_PALETTE ) - png_set_palette_to_rgb(png_ptr); - if ( png_get_bit_depth(png_ptr, info_ptr) < 8 ) { - if ( png_get_channels(png_ptr, info_ptr) < 3 ) { - png_set_expand_gray_1_2_4_to_8(png_ptr); - } else { - png_set_expand(png_ptr); - } - } - if ( png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS) ) - png_set_tRNS_to_alpha(png_ptr); - if ( png_get_bit_depth(png_ptr, info_ptr) == 16 ) - png_set_strip_16(png_ptr); - int number_of_passes = png_set_interlace_handling(png_ptr); - png_read_update_info(png_ptr, info_ptr); - - init_image(&image, width, height); - - if ( verbose ) - print_progress(0.0); - if ( png_get_interlace_type(png_ptr, info_ptr) == PNG_INTERLACE_NONE ) { - png_bytep row_pointer = png_malloc(png_ptr, width * png_get_channels(png_ptr, info_ptr) * 1); - for ( int y = 0; y < height; y++ ) { - png_read_row(png_ptr, row_pointer, NULL); - process_scanline_png(row_pointer, y, png_get_channels(png_ptr, info_ptr), &image); - if ( verbose ) - print_progress((float) y/height); - } - png_free(png_ptr, row_pointer); - } else { - png_bytepp row_pointers = png_malloc(png_ptr, height * sizeof(png_bytep)); - for ( int i = 0; i < height; ++i ) - row_pointers[i] = NULL; - for ( int i = 0; i < height; ++i ) - row_pointers[i] = png_malloc(png_ptr, width * png_get_channels(png_ptr, info_ptr) * 1); - // png_read_image would do the same thing, but progress could not be displayed - for ( int passes = 0; passes < number_of_passes; ++passes ) { - png_read_rows(png_ptr, row_pointers, NULL, height); - if ( verbose ) - print_progress((float) (passes + 1)/number_of_passes); + if ( height != 0 && width != 0 ) { + malloc_image(&image); + clear(&image); + + + // peform transformations (after printing the info): + if ( png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_PALETTE ) + png_set_palette_to_rgb(png_ptr); + if ( png_get_bit_depth(png_ptr, info_ptr) < 8 ) { + if ( png_get_channels(png_ptr, info_ptr) < 3 ) { + png_set_expand_gray_1_2_4_to_8(png_ptr); + } else { + png_set_expand(png_ptr); + } } - for ( int y = 0; y < height; y++ ) { - process_scanline_png(row_pointers[y], y, png_get_channels(png_ptr, info_ptr), &image); + if ( png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS) ) + png_set_tRNS_to_alpha(png_ptr); + if ( png_get_bit_depth(png_ptr, info_ptr) == 16 ) + png_set_strip_16(png_ptr); + int number_of_passes = png_set_interlace_handling(png_ptr); + png_read_update_info(png_ptr, info_ptr); + + init_image(&image, png_width, png_height); + + if ( verbose ) + print_progress(0.0); + if ( png_get_interlace_type(png_ptr, info_ptr) == PNG_INTERLACE_NONE ) { + png_bytep row_pointer = png_malloc(png_ptr, png_width * png_get_channels(png_ptr, info_ptr) * 1); + for ( int y = 0; y < png_height; y++ ) { + png_read_row(png_ptr, row_pointer, NULL); + process_scanline_png(row_pointer, y, png_get_channels(png_ptr, info_ptr), &image); + if ( verbose ) + print_progress((float) y/png_height); + } + png_free(png_ptr, row_pointer); + } else { + png_bytepp row_pointers = png_malloc(png_ptr, png_height * sizeof(png_bytep)); + for ( int i = 0; i < png_height; ++i ) + row_pointers[i] = NULL; + for ( int i = 0; i < png_height; ++i ) + row_pointers[i] = png_malloc(png_ptr, png_width * png_get_channels(png_ptr, info_ptr) * 1); + // png_read_image would do the same thing, but progress could not be displayed + for ( int passes = 0; passes < number_of_passes; ++passes ) { + png_read_rows(png_ptr, row_pointers, NULL, png_height); + if ( verbose ) + print_progress((float) (passes + 1)/number_of_passes); + } + for ( int y = 0; y < png_height; y++ ) { + process_scanline_png(row_pointers[y], y, png_get_channels(png_ptr, info_ptr), &image); + } + for ( int i = 0; i < png_height; ++i ) + png_free(png_ptr, row_pointers[i]); + png_free(png_ptr, row_pointers); } - for ( int i = 0; i < height; ++i ) - png_free(png_ptr, row_pointers[i]); - png_free(png_ptr, row_pointers); - } - if ( verbose ) - print_progress(1.0); - png_read_end(png_ptr, NULL); + if ( verbose ) + print_progress(1.0); + png_read_end(png_ptr, NULL); - print_image(&image, fout); + print_image(&image, fout); - free_image(&image); + free_image(&image); + } png_destroy_read_struct(&png_ptr, &info_ptr, NULL); } Binary files old/jp2a-1.1.0/tests/long.jpg and new/jp2a-1.1.1/tests/long.jpg differ Binary files old/jp2a-1.1.0/tests/long.png and new/jp2a-1.1.1/tests/long.png differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jp2a-1.1.0/tests/run-tests.sh new/jp2a-1.1.1/tests/run-tests.sh --- old/jp2a-1.1.0/tests/run-tests.sh 2020-10-06 13:45:32.000000000 +0200 +++ new/jp2a-1.1.1/tests/run-tests.sh 2021-11-20 20:10:37.000000000 +0100 @@ -154,5 +154,7 @@ test_jp2a "PNG interlaced 16-bit" "--size=300x150 --color jp2a-interlaced-16-bit.png" jp2a-png-interlaced-16-bit.txt test_jp2a "size, curl download" "--size=454x207 http://jp2a.sourceforge.net/jp2a.jpg" normal-curl.txt test_jp2a "size, curl download" "--size=454x207 http://jp2a.sf.net/jp2a.jpg" normal-curl.txt +test_jp2a "very long jpg" "long.jpg" no-output.txt +test_jp2a "very long png" "long.png" no-output.txt test_results
