Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package jp2a for openSUSE:Factory checked in at 2024-01-08 23:45:33 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/jp2a (Old) and /work/SRC/openSUSE:Factory/.jp2a.new.21961 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "jp2a" Mon Jan 8 23:45:33 2024 rev:6 rq:1137490 version:1.2.0 Changes: -------- --- /work/SRC/openSUSE:Factory/jp2a/jp2a.changes 2021-12-07 00:00:57.220230946 +0100 +++ /work/SRC/openSUSE:Factory/.jp2a.new.21961/jp2a.changes 2024-01-08 23:45:37.139090098 +0100 @@ -1,0 +2,6 @@ +Mon Jan 8 08:16:06 UTC 2024 - Sebastian Wagner <[email protected]> + +- Update to version 1.2.0: + * Add edge shading - edge shading can be enabled by setting the desired edge threshold with --edge-threshold=N.N. + +------------------------------------------------------------------- Old: ---- jp2a-1.1.1.tar.gz New: ---- jp2a-1.2.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ jp2a.spec ++++++ --- /var/tmp/diff_new_pack.iNcLXk/_old 2024-01-08 23:45:38.247130384 +0100 +++ /var/tmp/diff_new_pack.iNcLXk/_new 2024-01-08 23:45:38.259130820 +0100 @@ -1,7 +1,7 @@ # # spec file for package jp2a # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,7 +18,7 @@ %{!?license: %global license %doc} Name: jp2a -Version: 1.1.1 +Version: 1.2.0 Release: 0 Summary: Converts JPEG images to ASCII License: GPL-2.0-only ++++++ jp2a-1.1.1.tar.gz -> jp2a-1.2.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jp2a-1.1.1/.github/workflows/publish-docker-image.yml new/jp2a-1.2.0/.github/workflows/publish-docker-image.yml --- old/jp2a-1.1.1/.github/workflows/publish-docker-image.yml 2021-11-20 20:10:37.000000000 +0100 +++ new/jp2a-1.2.0/.github/workflows/publish-docker-image.yml 2024-01-07 21:05:16.000000000 +0100 @@ -3,6 +3,8 @@ on: release: types: [published] + schedule: + - cron: '21 12 21 * *' jobs: push_to_registry: @@ -10,35 +12,40 @@ runs-on: ubuntu-latest steps: - name: Check out the repo - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Log in to Docker Hub - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_HUB_USERNAME }} password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} - name: Set up QEMU - uses: docker/setup-qemu-action@v1 + uses: docker/setup-qemu-action@v3 with: platforms: all - name: Set up Docker Buildx id: buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v3 - name: Extract metadata (tags, labels) for Docker id: meta uses: docker/metadata-action@v3 with: images: talinx/jp2a + tags: | + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=schedule,pattern=nightly + flavor: | + latest=true - name: Build and push - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v5 with: - builder: ${{ steps.buildx.outputs.name }} context: . - platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/ppc64le + platforms: linux/amd64,linux/arm64/v8,linux/riscv64,linux/ppc64le,linux/arm/v7 push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jp2a-1.1.1/.gitignore new/jp2a-1.2.0/.gitignore --- old/jp2a-1.1.1/.gitignore 2021-11-20 20:10:37.000000000 +0100 +++ new/jp2a-1.2.0/.gitignore 2024-01-07 21:05:16.000000000 +0100 @@ -18,3 +18,4 @@ stamp-h1 Doxyfile doxygen-doc/ +INSTALL diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jp2a-1.1.1/ChangeLog new/jp2a-1.2.0/ChangeLog --- old/jp2a-1.1.1/ChangeLog 2021-11-20 20:10:37.000000000 +0100 +++ new/jp2a-1.2.0/ChangeLog 2024-01-07 21:05:16.000000000 +0100 @@ -1,3 +1,6 @@ +CHANGES SINCE 1.2.0 +- Add edge shading - edge shading can be enabled by setting the desired edge threshold with --edge-threshold=N.N. Thanks to Oscar Saharoy (https://github.com/OscarSaharoy) + CHANGES SINCE 1.1.1 - Fix images with very high aspect ratio, e.g. 3000:1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jp2a-1.1.1/INSTALL new/jp2a-1.2.0/INSTALL --- old/jp2a-1.1.1/INSTALL 2021-11-20 20:10:37.000000000 +0100 +++ new/jp2a-1.2.0/INSTALL 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -See the README file for building and installation instructions. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jp2a-1.1.1/README new/jp2a-1.2.0/README --- old/jp2a-1.1.1/README 2021-11-20 20:10:37.000000000 +0100 +++ new/jp2a-1.2.0/README 2024-01-07 21:05:16.000000000 +0100 @@ -78,6 +78,15 @@ Look in your system's package manager. I don't maintain Windows binaries anymore. +Docker +------ + +You can run jp2a using [Docker](https://www.docker.com/): +``` +docker run -t --rm -e COLORTERM="$COLORTERM" -v "$(pwd)":/app talinx/jp2a [options] <filenames or URLs> +``` +See [hub.docker.com/r/talinx/jp2a](https://hub.docker.com/r/talinx/jp2a) for details. + Building -------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jp2a-1.1.1/completion/bash/jp2a new/jp2a-1.2.0/completion/bash/jp2a --- old/jp2a-1.1.1/completion/bash/jp2a 2021-11-20 20:10:37.000000000 +0100 +++ new/jp2a-1.2.0/completion/bash/jp2a 2024-01-07 21:05:16.000000000 +0100 @@ -10,10 +10,13 @@ --grayscale --html --htmlls --xhtml --html-fill --html-no-bold --html-raw --border --invert --background= --flipx --flipy --version --width= --height= --red= --green= --blue= --html-fontsize= --size= --term-zoom - --term-height --term-width --term-fit --output= --html-title= --chars=" + --term-height --term-width --term-fit --output= --html-title= --chars= + --edge-threshold= --edges-only" case $cur in --*) COMPREPLY=( $(compgen -W "${OPTS}" -- $cur) ) + # Add space if there is not a '=' in suggestions + [[ ! "${COMPREPLY[@]}" =~ "=" ]] && compopt +o nospace return 0 ;; esac @@ -22,6 +25,6 @@ COMPREPLY=( $(compgen -f -- $cur) ) return 0 } -complete -F _jp2a jp2a +complete -F _jp2a -o nospace jp2a # ex: filetype=sh \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jp2a-1.1.1/configure.ac new/jp2a-1.2.0/configure.ac --- old/jp2a-1.1.1/configure.ac 2021-11-20 20:10:37.000000000 +0100 +++ new/jp2a-1.2.0/configure.ac 2024-01-07 21:05:16.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.1],[[email protected]], [jp2a], [https://github.com/Talinx/jp2a]) +AC_INIT([jp2a],[1.2.0],[[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) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jp2a-1.1.1/include/options.h new/jp2a-1.2.0/include/options.h --- old/jp2a-1.1.1/include/options.h 2021-11-20 20:10:37.000000000 +0100 +++ new/jp2a-1.2.0/include/options.h 2024-01-07 21:05:16.000000000 +0100 @@ -18,6 +18,8 @@ #define ASCII_PALETTE_DEFAULT " ...',;:clodxkO0KXNWM"; //! default title for HTML/XHTML documents #define HTML_DEFAULT_TITLE "jp2a converted image" +//! default edge_threshold - very high so no edges will be drawn +#define EDGE_THRESHOLD_DEFAULT 1000. extern int verbose; //!< produce verbose output extern int auto_height; //!< automatically calculate the output width from the height @@ -39,6 +41,8 @@ extern int html_bold; //!< use bold characters in HTML output extern int debug; //!< print debug information extern int clearscr; //!< clear the screen before printing an image +extern float edge_threshold; //!< image gradient above which edges should be drawn with /-\| characters +extern int edges_only; //!< only draw edges - make sure you use it with the edge-threshold option so edges are drawn extern int ascii_palette_length; //!< number of charactrs in the palette extern char ascii_palette[]; //!< the palette #if ! ASCII diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jp2a-1.1.1/man/jp2a.1 new/jp2a-1.2.0/man/jp2a.1 --- old/jp2a-1.1.1/man/jp2a.1 2021-11-20 20:10:37.000000000 +0100 +++ new/jp2a-1.2.0/man/jp2a.1 2024-01-07 21:05:16.000000000 +0100 @@ -1,4 +1,4 @@ -.TH jp2a 1 "November 20, 2020" "version 1.1.1" "USER COMMANDS" +.TH jp2a 1 "January 7, 2024" "version 1.2.0" "USER COMMANDS" .SH NAME jp2a \- convert JPEG and PNG images to ASCII .SH SYNOPSIS @@ -135,6 +135,14 @@ .B \-\-zoom Sets output dimensions to your entire terminal window, disregarding source image aspect ratio. +.TP +.B \-\-edge\-threshold= ... +Specifies an image gradient above which to shade lines and edges with directional glyphs (such as -/|\\). +The right value to pick up the edges nicely will depend on the image but might be around 0.5. +.TP +.B \-\-edges-only +Only draw edges, so that the resulting image is like a line drawing or edge detector. This option should +be used in conjunction with \-\-edge\-threshold so that edges are drawn. .SH RETURN VALUES jp2a returns 1 when errors are encountered, zero for no errors. .SH EXAMPLES @@ -180,6 +188,12 @@ \- jpg:- | .B jp2a \- +.PP +You can pass the \-\-edge\-threshold option to highlight the edges of the image, or add the +\-\-edges\-only option to draw only the edges, to produce a line drawing. +.PP +.B jp2a +\-\-edge\-threshold=0.5 \-\-edges\-only imagefile.jpg .SH DOWNLOADING IMAGES FROM THE NET If you have compiled jp2a with libcurl(3), you can download images by specifying URLs: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jp2a-1.1.1/src/image.c new/jp2a-1.2.0/src/image.c --- old/jp2a-1.1.1/src/image.c 2021-11-20 20:10:37.000000000 +0100 +++ new/jp2a-1.2.0/src/image.c 2024-01-07 21:05:16.000000000 +0100 @@ -26,9 +26,12 @@ #include "jp2a.h" #include "options.h" #include "html.h" +#include <math.h> #define ROUND(x) (int) ( 0.5f + x ) +static char DIRECTIONAL_CHARS[4] = "=/|\\"; + void print_border(const int width) { #ifndef HAVE_MEMSET int n; @@ -79,51 +82,97 @@ else if ( xhtml && !html_rawoutput ) print_xhtml_image_end(f); } -void print_image_colors(const Image* const image, const int chars, FILE* f) { +int get_pixel_index(const Image* const image, const int x, const int y) { + const float fx = flipx ? image->width - x - 1 : x; + const float fy = flipy ? image->height - y - 1 : y; + const int cx = fx < 0 ? 0 : fx > image->width - 1 ? image->width - 1 : fx; + const int cy = fy < 0 ? 0 : fy > image->height - 1 ? image->height - 1 : fy; + return cx + cy * image->width; +} - int x, y; - int xstart, xend, xincr; +typedef struct { + float x; + float y; +} vec2; + +vec2 get_image_gradient(const Image* const image, const int x, const int y) { + const float kernel_x[4] = { + -1., 0., + 1., 0. + }; + const float kernel_y[4] = { + -1., 1., + 0., 0. + }; + const float patch[4] = { + image->pixel[get_pixel_index(image, x , y )], + image->pixel[get_pixel_index(image, x+1, y )], + image->pixel[get_pixel_index(image, x , y+1)], + image->pixel[get_pixel_index(image, x+1, y+1)], + }; + vec2 grad = {0., 0.}; + for( int i = 0; i < 4; ++i ) { + grad.x += kernel_x[i] * patch[i]; + grad.y += kernel_y[i] * patch[i]; + } + return grad; +} - for ( y=0; y < image->height; ++y ) { +float magnitude( const vec2 v ) { + return sqrtf( v.x*v.x + v.y*v.y ); +} - if ( use_border ) fprintf(f, "|"); +float direction( const vec2 v ) { + return atan(v.y / v.x); +} - xstart = 0; - xend = image->width; - xincr = 1; - - if ( flipx ) { - xstart = image->width - 1; - xend = -1; - xincr = -1; - } +void print_image_colors(const Image* const image, const int chars, FILE* f) { - for ( x=xstart; x != xend; x += xincr ) { + for ( int y=0; y < image->height; ++y ) { - float Y = image->pixel[x + (flipy? image->height - y - 1 : y ) * image->width]; - float Y_inv = 1.0f - Y; - float R = image->red [x + (flipy? image->height - y - 1 : y ) * image->width]; - float G = image->green[x + (flipy? image->height - y - 1 : y ) * image->width]; - float B = image->blue [x + (flipy? image->height - y - 1 : y ) * image->width]; - float A = image->alpha [x + (flipy? image->height - y - 1 : y ) * image->width]; + if ( use_border ) fprintf(f, "|"); + + for ( int x=0; x < image->width; x += 1 ) { + + const int pixel_index = get_pixel_index(image, x, y); + float Y = image->pixel[pixel_index]; + float R = image->red [pixel_index]; + float G = image->green[pixel_index]; + float B = image->blue [pixel_index]; + float A = image->alpha[pixel_index]; R *= A; G *= A; B *= A; + const vec2 gradient = get_image_gradient(image, x, y); + int pos = ROUND((float)chars * Y); - const int pos = ROUND((float)chars * (!invert? Y_inv : Y)); - int i = ROUND((float)pos * A); -#if ASCII - char ch = ascii_palette[i]; -#define PRINTF_FORMAT_TYPE "%c" -#else - char ch[MB_LEN_MAX + 1]; - ch[0] = ascii_palette[ascii_palette_indizes[i]]; - for ( size_t j = 1; j < ascii_palette_lengths[i]; j++ ) { - ch[j] = ascii_palette[ascii_palette_indizes[i] + j]; + if( edges_only && magnitude(gradient) < edge_threshold ) { + pos = 0; } - ch[ascii_palette_lengths[i]] = '\0'; + + int i = invert? pos : chars - pos; + i = ROUND((float)i * A); + + char ch[MB_LEN_MAX + 1]; #define PRINTF_FORMAT_TYPE "%s" + +#if ASCII + char* char_start = &ascii_palette[i]; + size_t char_len = 1; +#else + char* char_start = &ascii_palette[ascii_palette_indizes[i]]; + size_t char_len = ascii_palette_lengths[i]; #endif + if( magnitude(gradient) > edge_threshold ) { + // scale the gradient direction in the range -2 to 2, then add .5 to offset direction bins to match character directions + float direction_scaled = direction(gradient) / M_PI * 4. + .5; + // use +4 and fmod to bring the direction into the range 0-4, then use (int) to get an index 0-3 into DIRECTIONAL_CHARS array + char_start = &DIRECTIONAL_CHARS[ (int) fmod(direction_scaled + 4., 4.) ]; + char_len = 1; + } + + memcpy(ch, char_start, char_len); + ch[char_len] = '\0'; const float min = 1.0f / 255.0f; @@ -268,8 +317,6 @@ } void print_image_no_colors(const Image* const image, const int chars, FILE *f) { - int x, y; - #if ASCII #ifdef WIN32 char *line = (char*) malloc(image->width + 1); @@ -283,53 +330,52 @@ #else char line[image->width * MB_LEN_MAX + 1]; #endif - int curLinePos; line[image->width * MB_LEN_MAX] = 0; #endif - for ( y=0; y < image->height; ++y ) { + for ( int y=0; y < image->height; ++y ) { -#if ! ASCII - curLinePos = flipx? image->width * MB_LEN_MAX : 0; -#endif - for ( x=0; x < image->width; ++x ) { + int curLinePos = 0; + for ( int x=0; x < image->width; ++x ) { + + const int pixel_index = get_pixel_index(image, x, y); + const float lum = image->pixel[pixel_index]; + const float opacity = image->alpha[pixel_index]; + const vec2 gradient = get_image_gradient(image, x, y); + int pos = ROUND((float)chars * lum); - const float lum = image->pixel[x + (flipy? image->height - y - 1 : y) * image->width]; - const float opacity = image->alpha[x + (flipy? image->height - y - 1 : y) * image->width]; - const int pos = ROUND((float)chars * lum); + if( edges_only && magnitude(gradient) < edge_threshold ) { + pos = 0; + } int i = invert? pos : chars - pos; i = ROUND((float)i * opacity); + + char* char_dest = &line[curLinePos]; #if ASCII - line[flipx? image->width - x - 1 : x] = ascii_palette[i]; + char* char_start = &ascii_palette[i]; + size_t char_len = 1; #else - int paletteI = ascii_palette_indizes[i]; - if ( flipx ) - curLinePos -= ascii_palette_lengths[i]; - line[curLinePos++] = ascii_palette[paletteI]; - // Add as many bytes as the char's length - for ( size_t j = 1; j < ascii_palette_lengths[i]; j++ ) { - line[curLinePos++] = ascii_palette[++paletteI]; - } - if ( flipx ) - curLinePos -= ascii_palette_lengths[i]; + char* char_start = &ascii_palette[ascii_palette_indizes[i]]; + size_t char_len = ascii_palette_lengths[i]; #endif - } -#if ASCII - fprintf(f, !use_border? "%s\n" : "|%s|\n", line); -#else - if ( !flipx ) { + if( magnitude(gradient) > edge_threshold ) { + // scale the gradient direction in the range -2 to 2, then add .5 to offset direction bins to match character directions + float direction_scaled = direction(gradient) / M_PI * 4. + .5; + // use +4 and fmod to bring the direction into the range 0-4, then use (int) to get an index 0-3 into DIRECTIONAL_CHARS array + char_start = &DIRECTIONAL_CHARS[ (int) fmod(direction_scaled + 4., 4.) ]; + char_len = 1; + } + memcpy(char_dest, char_start, char_len); + curLinePos += char_len; line[curLinePos] = '\0'; - fprintf(f, !use_border? "%s\n" : "|%s|\n", line); - } else { - fprintf(f, !use_border? "%s\n" : "|%s|\n", line + curLinePos); } -#endif + fprintf(f, !use_border? "%s\n" : "|%s|\n", line); } - #ifdef WIN32 +#ifdef WIN32 free(line); - #endif +#endif } void clear(Image* i) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jp2a-1.1.1/src/options.c new/jp2a-1.2.0/src/options.c --- old/jp2a-1.1.1/src/options.c 2021-11-20 20:10:37.000000000 +0100 +++ new/jp2a-1.2.0/src/options.c 2024-01-07 21:05:16.000000000 +0100 @@ -61,6 +61,8 @@ int html_rawoutput = 0; int debug = 0; int clearscr = 0; +float edge_threshold = EDGE_THRESHOLD_DEFAULT; +int edges_only = 0; int term_width = 0; int term_height = 0; int usecolors = 0; @@ -130,6 +132,8 @@ " values are: 4 (for ANSI), 8 (for 256 color palette)\n" " and 24 (for truecolor or 24-bit color).\n" " -d, --debug Print additional debug information.\n" +" --edge-threshold=N.N Image gradient above which to shade lines and edges with directional glyphs (such as -/|\\).\n" +" --edges-only Only draw edges - make sure you use it with the edge-threshold option so edges are drawn.\n" " --fill When used with --color and/or --htmlls or --xhtml, color\n" " each character's background.\n" " -x, --flipx Flip image in X direction.\n" @@ -253,6 +257,7 @@ IF_OPTS("-x", "--flipx") { flipx = 1; continue; } IF_OPTS("-y", "--flipy") { flipy = 1; continue; } IF_OPTS("-V", "--version") { print_version(); exit(0); } + IF_OPT("--edges-only") { edges_only = 1; continue; } IF_VAR ("--width=%d", &width) { auto_height += 1; continue; } IF_VAR ("--height=%d", &height) { auto_width += 1; continue; } IF_VAR ("--red=%f", &redweight) { continue; } @@ -260,6 +265,8 @@ IF_VAR ("--blue=%f", &blueweight) { continue; } IF_VAR ("--html-fontsize=%d", &html_fontsize) { continue; } + IF_VAR ("--edge-threshold=%f", + &edge_threshold) { continue; } IF_VARS("--size=%dx%d",&width, &height) { auto_width = auto_height = 0; continue; @@ -451,5 +458,10 @@ } } + if ( edges_only && edge_threshold == EDGE_THRESHOLD_DEFAULT ) { + fputs("If you pass the --edges-only option, you must also pass the --edge-threshold= option.\n", stderr); + exit(1); + } + precalc_rgb(redweight, greenweight, blueweight); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jp2a-1.1.1/tests/edges-only-invert.txt new/jp2a-1.2.0/tests/edges-only-invert.txt --- old/jp2a-1.1.1/tests/edges-only-invert.txt 1970-01-01 01:00:00.000000000 +0100 +++ new/jp2a-1.2.0/tests/edges-only-invert.txt 2024-01-07 21:05:16.000000000 +0100 @@ -0,0 +1,40 @@ +MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM +MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM +MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM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MMMMMM=======MMMMMMMMMMMMMM +MMMMMMM===========MMMMMMM==========MM=============MMMMMMMMMMM||M===/===M==\\MMMMMMMMMMM||MMMMMMMMMMM===================MMMMMMMMM +MMMMMM|/MMMMMMMM\\MMMMMMMMMMMMMMM\\===/MMMMMMMM=====MMMMMMMMM|\==//MMMMMMMM|\MMMMMMMMMM||MMMMMMMM=/======MMMMMMMMMM=====MMMMMMMM +MMMMMM||MMMMMMMMM|MMMMMM||MMMMMMMMM=MMMMMMMMMMMMMMM\===MMMMMMMM/MMMMMMMMMMM||MMMMMMMMMM/|MMMMMMM/=/MMMMMMMMMMMMMMMMMMMM\\=MMMMMM +MMMMMM||MMMMMMMMM|MMMMMM||MMMMMMMMMMMM====MMMMMMMMMM\\\MMMMMMMMMMMMMMMMMMMM||MMMMMMMMM///MMMMMM||MMMM==========MMMMMMMMMM\\MMMMM +MMMMMM||MMMMMMMMM|MMMMMM||MMMMMMMMM=========MMMMMMMMMM|\MMMMMMMMMMMMMMMMMMM||MMMMMMMM|/MMMMMMMM||MM==/===MMMM\\=MMMMMMMMM||MMMMM +MMMMMM||MMMMMMMMM|MMMMMM||MMMMMMMM/=/MMMMM\\\MMMMMMMMM||MMMMMMMMMMMMMMMMMMM//MMMMMMMM//MMMMMMMM|\=/==MMMMMMMMMM/|MMMMMMMM||MMMMM +MMMMMM||MMMMMMMMM|MMMMMM||MMMMMMM||MMMMMMMM|\=MMMMMMMM||MMMMMMMMMMMMMMMMM=//MMMMMMM=//MMMMMMMMMM\=/MMM=========//MMMMMMMM||MMMMM +MMMMMM||MMMMMMMMM|MMMMMM||MMMMMMM||MMMMMMMMMM\MMMMMMMM||MMMMMMMMMMMMMMMM///MMMMMM=///MMMMMMMMMMMMMM=========MMMMMMMMMMMMM||MMMMM +MMMMMM||MMMMMMMMM|MMMMMM||MMMMMMM||MMMMMMMMMM/|MMMMMMM||MMMMMMMMMMMMMM=//MMMMMMM///MMMMMMMMMMMMMM=/==/MMMMM====\MMMMMMMMM||MMMMM +MMMMMM||MMMMMMMMM|MMMMMM||MMMMMMM||MMMMMMMM////MMMMMMM|/MMMMMMMMMMMM=///MMMMMMM/|M========MMMMM////MMMMMMM/===M||MMMMMMMM||MMMMM +MMMMMM||MMMMMMMMM|MMMMMM||MMMMMMM|\========//MMMMMMMMM//MMMMMMMMMM////MMMMMMMMM\===========MMMM//MMMMMMMM||MMMM/|MMMMMMMM||MMMMM +MMMMMM||MMMMMMMMM|MMMMMM||MMMMMMMMMM=====//MMMMMMMMMMM//MMMMMMMM////MMMMMMMMMMMMMMMMMMMMMM||M||MMMMMMMMMM\\==/=//MMMMMMMM|\====M +MMMMMM||MMMMMMMMM|MMMMMM||MMMMMMMMMMMMMMMMMMMMMMMMMM=//MMMMMMMM=//MMMMMMMMMMMMMMMMMMMMMMMM||M||\MMMMMMMMMM\==//MMMMMMMMMMMM==M\M +MMMMMM||MMMMMMMMM|MMMMMM||MMMMMMMMM=MMMMMMMMMMMMM==///MMMMMMM=//MMMMMMMMMMMMMMMMMMMMMMMMMM||MMM\\==MMMMMMMMMMM====MMMMMMMMMM==/M +MMMMMM||MMMMMMMMM|MMMMMM||MMMMMMMM/================/MMMMMMMMMM\===========================//MMMM\=============================/M +MMMMMM/|MMMMMMMMM|MMMMMM||MMMMMMM||MMMM=======/MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM=========MMMMMM=======/MMMMM +MMMMM///MMMMMMMM||MMMMMM||MMMMMMM||MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM +MMMM//MMMMMMMMMM//MMMMMM||MMMMMMM||MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM +MMM\|MMMMMMMMMM=//MMMMMM||MMMMMMM||MMMMMMMM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MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM +MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM +MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jp2a-1.1.1/tests/edges-only.txt new/jp2a-1.2.0/tests/edges-only.txt --- old/jp2a-1.1.1/tests/edges-only.txt 1970-01-01 01:00:00.000000000 +0100 +++ new/jp2a-1.2.0/tests/edges-only.txt 2024-01-07 21:05:16.000000000 +0100 @@ -0,0 +1,40 @@ + + + + + + === ======== + ========= ================= + |/ \\ ====/ ===== + || || /== \\ + |\== ===// || \\= + ====== ====== || ========= |\\ ======= + =========== ========== ============= || ===/=== ==\\ || =================== + |/ \\ \\===/ ===== |\==// |\ || =/====== ===== + || | || = \=== / || /| /=/ \\= + || | || ==== \\\ || /// || ========== \\ + || | || ========= |\ || |/ || ==/=== \\= || + || | || /=/ \\\ || // // |\=/== /| || + || | || || |\= || =// =// \=/ =========// || + || | || || \ || /// =/// ========= || + || | || || /| || =// /// =/==/ ====\ || + || | || || //// |/ =/// /| ======== //// /=== || || + || | || |\========// // //// \=========== // || /| || + || | || =====// // //// || || \\==/=// |\==== + || | || =// =// || ||\ \==// == \ + || | || = ==/// =// || \\== ==== ==/ + || | || /================/ \===========================// \=============================/ + /| | || || =======/ ========= =======/ + /// || || || + // // || || + \| =// || || + |\ =// || || + |\ =/// || || + |\======/ \\=======// + + + + + + + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jp2a-1.1.1/tests/edges.txt new/jp2a-1.2.0/tests/edges.txt --- old/jp2a-1.1.1/tests/edges.txt 1970-01-01 01:00:00.000000000 +0100 +++ new/jp2a-1.2.0/tests/edges.txt 2024-01-07 21:05:16.000000000 +0100 @@ -0,0 +1,40 @@ +MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM +MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM +MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM +MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM +MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM +MMMMMMMMMMM===MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM========MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM +MMMMMMMM=========MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM=================MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM +MMMMMMM|/.. \\KMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM====/'. .=====MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM +MMMMMMM|| ||MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMW/==. .\\WMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM +MMMMMMM|\== ===//MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMW|| \\=MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM +MMMMMMMWx======okXMMMMMMMMMMMMMMMMMMMMMM======MMMMMMMMMMMMMMN|| ========= |\\KMMMMMMMMMMMMMMMMMM=======MMMMMMMMMMMMMM +MMMMMMW===========WMMMMWN==========MM=============MMMMMMMMMMN|| ===/===O==\\ .||MMMMMMMMMMM===================MMMMMMMMM +MMMMMW|/''''''''\\KMMMMXOl'''''''\\===/'.......=====MMMMMMMMN|\==//KMMMMMMW|\ ||MMMMMMMM=/======..........=====WMMMMMMM +MMMMMW|| |0MMMMK|| .=. ..\===MMMMMNXk/XNMMMMMMMMM||. /|MMMMMMW/=/'. .\\=WMMMMM +MMMMMW|| |0MMMMK|| ==== \\\WMMMMMWWWMMMMMMMMMMM||.. ///MMMMMW|| ========== .\\MMMMM +MMMMMW|| |0MMMMK|| ========= |\MMMMMMMMMMMMMMMMMMM|| |/KNMMMMMN|| ==/===00KK\\=. ||WMMMM +MMMMMW|| |0MMMMK|| /=/0XNNX\\\ ||WMMMMMMMMMMMMMMMMMM// //MMMMMMMN|\=/==KWMMMMMMMK/| ||NMMMM +MMMMMW|| |0MMMMK|| ||NWMMMMMW|\= ||KNMMMMMMMMMMMMMMM=//. =//XMMMMMMMWX\=/NMM=========// ||XMMMM +MMMMMW|| |0MMMMK|| ||WWMMMMMMM0\' ||xKMMMMMMMMMMMMMM///. =///KMMMMMMMMMWWWW========='.. ||XMMMM +MMMMMW|| |0MMMMK|| ||WWMMMMMMMX/| ||xKMMMMMMMMMMMM=//. ///XMMMMMMMMMMMMM=/==/ ====\. ||XMMMM +MMMMMW|| |0MMMMK|| ||WWMMMMMM//// |/OXMMMMMMMMMM=///. /|0========MMMMM//// /===0|| ||XMMMM +MMMMMW|| |0MMMMK|| |\========//. //NWMMMMMMMM////. .\===========XMMK// ||XWMN/| ||NMMMM +MMMMMW|| |0MMMMK|| .=====// //MMMMMMMM//// .||M||,. .\\==/=// |\====N +MMMMMW|| |0MMMMK|| =//WMMMMMMM=//. .||M||\. \==//. ==:\k +MMMMMW|| |0MMMMK|| = ==///KMMMMMM=//. .||MMK\\== ...==== ==/d +MMMMMW|| |0MMMMK|| /================/XMMMMMMMKk\===========================//MMWW\=============================/0 +MMMMMN/| |0MMMMK|| ||WNKO=======/KNWMMMMMMMMMMX00O00000000000000000000000000KNMMMMMMW0=========KWMMMK=======/KNWMM +MMMMM/// ||KMMMMK|| ||WWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM +MMWW//. //XMMMMK|| ||WWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM +MMX\| =//WMMMMK|| ||WWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM +MMW|\ =//0NMMMMMK|| ||WWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM +MMMM|\ =///KMMMMMMMK|| ||WWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM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MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jp2a-1.1.1/tests/run-tests.sh new/jp2a-1.2.0/tests/run-tests.sh --- old/jp2a-1.1.1/tests/run-tests.sh 2021-11-20 20:10:37.000000000 +0100 +++ new/jp2a-1.2.0/tests/run-tests.sh 2024-01-07 21:05:16.000000000 +0100 @@ -10,6 +10,9 @@ UNAME=`uname -a` UPDATE=no +## FOR LOCAL DEPENDENT INPUTS LIKE --edge-threshold=0.3 TO BE INTERPRETED CORRECTLY +export LC_ALL=C + if test "`echo ${UNAME} | cut -c1-6`" == "CYGWIN" ; then JP=../src/jp2a.exe fi @@ -156,5 +159,8 @@ 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_jp2a "edges" "--width=128 --edge-threshold=0.3 jp2a.jpg" edges.txt +test_jp2a "edges only" "--width=128 --edge-threshold=0.3 --edges-only jp2a.jpg" edges-only.txt +test_jp2a "edges only, invert" "--width=128 --edge-threshold=0.3 --edges-only --invert jp2a.jpg" edges-only-invert.txt test_results
