diff --git a/.snapcraft.yaml b/.snapcraft.yaml deleted file mode 100644 index dcf3af94..00000000 --- a/.snapcraft.yaml +++ /dev/null @@ -1,83 +0,0 @@ -name: vips-nip2 -icon: share/nip2/data/vips-128.png -version: 'master' -summary: An image-processing spreadsheet. -description: | - nip2 is half-way between a spreadsheet and a paint program. - It's terrible for retouching photographs, but very handy for automating image - processing tasks. - - It can process multi-gigabyte images efficiently. It has good support for - scientific image formats. It's much faster and more flexible than tools like - ImageJ. - - This snap is git master nip2 built with git master libvips. - -grade: devel -confinement: strict - -apps: - nip2: - command: desktop-launch nip2 - desktop: share/applications/nip2.desktop - plugs: [x11, home, gsettings] - -parts: - vips-part: - source: https://github.com/jcupitt/libvips - source-branch: master - source-type: git - plugin: autotools - build-packages: - - gtk-doc-tools - - gobject-introspection - - intltool - - libgirepository1.0-dev - - libglib2.0-dev - - libfftw3-dev - - libexpat1-dev - - libxml2-dev - - libjpeg-turbo8-dev - - libtiff5-dev - - libopenslide-dev - - libopenexr-dev - - libcfitsio-dev - - libmatio-dev - - libgif-dev - - libpoppler-dev - - librsvg2-dev - - libmagickcore-6.q16-dev - - libexif-dev - - libgsf-1-dev - - liblcms2-dev - - libpng12-dev - - libfontconfig1-dev - - libgdk-pixbuf2.0-dev - - libfreetype6-dev - - libxft-dev - - libcairo2-dev - - libpango1.0-dev - - liborc-0.4-dev - - libwebp-dev - - nip2-part: - source: https://github.com/jcupitt/nip2 - source-branch: master - source-type: git - plugin: autotools - build-packages: - - gobject-introspection - - intltool - - libgirepository1.0-dev - - libglib2.0-dev - - libgtk2.0-dev - - libx11-dev - - libxml2-dev - - flex - - bison - - libfftw3-dev - - libgoffice-0.8-dev - - libgsl-dev - - libgvc6 - after: [desktop-gtk2, vips-part] - diff --git a/ChangeLog b/ChangeLog index 5584bb47..87c5bebd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,15 @@ +started 8.9.2 22/11/23 +- fix a lockup with comment characters in REPL [MvGulik] + +started 8.9.1 15/2/23 +- fix build with --std=c99 [Schamschula] + +started 8.9.0 10/4/20 +- add find_trim + started 8.7.1 13/11/18 - fix uint status bar pixels >2**31 [Rob Erdmann] +- fix crash on redhat [bgilbert] started 8.7.0 22/5/18 - added vips7compat.h include for libvips 8.7 diff --git a/Makefile.am b/Makefile.am index 5b5b4bbc..4c8aa931 100644 --- a/Makefile.am +++ b/Makefile.am @@ -10,6 +10,7 @@ EXTRA_DIST = \ doc \ proj \ m4 \ + screenshot.png \ nip2.desktop.in \ nip2.xml \ nip2.appdata.xml diff --git a/README.md b/README.md index 789579f1..3e57bffb 100644 --- a/README.md +++ b/README.md @@ -1,92 +1,70 @@ -# nip2 - a user interface for the VIPS image processing library +# nip2 --- a user interface for libvips -[![Snap -Status](https://build.snapcraft.io/badge/jcupitt/nip2.svg)](https://build.snapcraft.io/user/jcupitt/nip2) +We now have a first public test release of nip4, a rewrite of nip2 for the +gtk4 UI toolkit. If you have some time to try it, any feedback would +be very welcome: -nip2 is a GUI for the [VIPS image processing +https://github.com/jcupitt/nip4/releases + +## nip2 + +nip2 is a GUI for the [libvips image processing library](https://libvips.github.io/libvips). It's a little like a spreadsheet: you create a set of formula connecting your objects together, and on a change -nip2 recalculates. +nip2 will recalculate. This makes it convenient for developing image processing +systems since you can watch pixels change as you adjust your equations. + +Because nip2 uses libvips as the image processing engine it can handle very +large images and only needs a little memory. It scales to fairly complex +workflows: I've used it to develop systems with more than 10,000 cells, +analyzing images of many tens of gigabytes. It has a batch mode, so you +can run any image processing system you develop from the command-line and +without a GUI. + +![image](https://github.com/user-attachments/assets/aa2c3e0f-9f96-4594-9f1d-62ef770d0775) + +## Installing You can probably install nip2 via your package manager. For Windows and OS X, you can download a binary from the [nip2 releases -area](https://github.com/libvips/nip2/releases). Only read on if you want to -compile yourself from source. +page](https://github.com/libvips/nip2/releases). If you have to build from +source, see the section below. -# Documentation +## Documentation nip2 comes with a 50-page manual --- press F1 or Help / Contents in the program to view it. -# Building nip2 from source - -In the nip2 directory you should just be able to do: +## Building nip2 from source - $ ./configure - $ make - $ sudo make install +In the nip2 directory you should just be able to do the usual: -By default this will install files to `/usr/local`. +``` +./configure +make +sudo make install +``` -See the Dependencies section below for a list of the things that -nip2 needs in order to be able to build. +By default this will install files to `/usr/local`. Check the summary at the +end of `configure` and make sure you have all of the features you want. If you downloaded from GIT you'll need: - $ ./autogen.sh +``` +./autogen.sh +``` first to build the configure system. -# Dependencies - nip2 needs vips, gtk2 and libxml2 at runtime and flex/bison at compile time. +If you have fftw3, gsl, goffice, libgvc you get extra features. -If you have fftw3, gsl, goffice, libgvc you get extra optional, but useful, -features. - -# Tips - -production build with - - ./configure --prefix=/home/john/vips - -debug build with - - CFLAGS="-g -Wall" ./configure --prefix=/home/john/vips - -(--enable-debug turns on and off automatically with development / production -minor version numbers) - -leak check - - export G_DEBUG=gc-friendly - export G_SLICE=always-malloc - valgrind --suppressions=/home/john/nip2.supp \ - --leak-check=yes \ - nip2 ... > nip2-vg.log 2>&1 - -memory access check - - valgrind --suppressions=/home/john/nip2.supp \ - --leak-check=no --db-attach=yes \ - nip2 ... > nip2-vg.log 2>&1 - -or put "--suppressions=/home/john/nip2.supp" into ~/.valgrindrc - -profiling - - valgrind --tool=callgrind \ - --suppressions=/home/john/nip2.supp \ - nip2 ... > nip2-vg.log 2>&1 - -Disclaimer: No guarantees of performance accompany this software, nor is any -responsibility assumed on the part of the authors. Please read the licence -agreement. - -# snapcraft +### snapcraft Rebuild snap with: - snapcraft cleanbuild +``` +snapcraft cleanbuild +``` Though it's done automatically on a push. diff --git a/configure.ac b/configure.ac index 15ada319..ac6a03b4 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ # Process this file with autoconf to produce a configure script. -AC_INIT([nip2], [8.7.1], [vipsip@jiscmail.ac.uk]) +AC_INIT([nip2], [8.9.2], [vipsip@jiscmail.ac.uk]) # foreign stops complaints about a missing README (we use README.md instead) # and missing INSTALL (the standard Gnu INSTALL is not very useful) @@ -16,8 +16,8 @@ dnl of them. dnl m4_define([nip_major_version], [8]) -m4_define([nip_minor_version], [7]) -m4_define([nip_micro_version], [1]) +m4_define([nip_minor_version], [9]) +m4_define([nip_micro_version], [2]) m4_define([nip_version], [nip_major_version.nip_minor_version.nip_micro_version]) diff --git a/doc/src/program.tex b/doc/src/program.tex index 3ff4a811..5fa53827 100644 --- a/doc/src/program.tex +++ b/doc/src/program.tex @@ -821,7 +821,8 @@ \section{Lists and recursion} \ct{map3 fn l1 l2 l3} & map 3-ary function \ct{fn} over lists \ct{l1}, \ct{l2} and \ct{l3} \\ \ct{member l x} & true if \ct{x} is a member of list \ct{l} \\ -\ct{mkset l} & remove duplicates from list \ct{l} \\ +\ct{mkset eq l} & remove duplicates from list \ct{l} with equality + function \ct{eq} \\ \ct{postfix l r} & add element \ct{r} to the end of list \ct{l} \\ \ct{product l} & product of list l \\ \ct{repeat x} & make an infinite list of \ct{x}es \\ @@ -1510,7 +1511,7 @@ \subsection{Workspaces} \subsection{The \ct{Image} class} \mylabel{sec:Image}. -say supports mioxed ops with real, vector and complex constants +say supports mixed ops with real, vector and complex constants \subsection{The \ct{Colour} class} \mylabel{sec:colour} diff --git a/share/nip2/start/Image.def b/share/nip2/start/Image.def index 962dbd18..4c0deb53 100644 --- a/share/nip2/start/Image.def +++ b/share/nip2/start/Image.def @@ -1286,6 +1286,29 @@ Image_crop_item = class } } +Trim_item = class Menuaction "_Trim" "crop away edges" { + action x = class + _result { + _vislevel = 3; + + thresh = Scale "threshold" 0 100 10; + background = Expression "Background" default_background + { + default_background + = map mean (bandsplit (extract_area 0 0 1 1 x)); + } + + _result + = Region x l t w h + { + [l, t, w, h] = vips_call "find_trim" [x.value] [ + $threshold => thresh.value, + $background => background.expr + ]; + } + } +} + Image_insert_item = class Menuaction "_Insert" "insert a small image into a large image" { action a b diff --git a/src/compile.c b/src/compile.c index bd9c6ae3..ecf40b85 100644 --- a/src/compile.c +++ b/src/compile.c @@ -815,7 +815,7 @@ compile_graph( Compile *compile, ParseNode *pn, PElement *out ) break; case PARSE_CONST_BOOL: - PEPUTP( out, ELEMENT_BOOL, pn->con.val.bool ); + PEPUTP( out, ELEMENT_BOOL, pn->con.val.bol ); break; case PARSE_CONST_ELIST: @@ -2523,7 +2523,7 @@ compile_pattern_condition( Compile *compile, int i; n.type = PARSE_CONST_BOOL; - n.val.bool = TRUE; + n.val.bol = TRUE; node = tree_const_new( compile, n ); for( i = depth - 1; i >= 0; i-- ) { diff --git a/src/dummy.c b/src/dummy.c new file mode 100644 index 00000000..679b26f3 --- /dev/null +++ b/src/dummy.c @@ -0,0 +1 @@ +int poop () {} diff --git a/src/heap.c b/src/heap.c index 919f90a6..5e9e9787 100644 --- a/src/heap.c +++ b/src/heap.c @@ -1895,12 +1895,13 @@ heap_ip_to_gvalue( PElement *in, GValue *out ) */ else if( heap_is_imagevec( in, &result ) && result ) { - Imageinfo *iivec[100]; + Imageinfo *iivec[MAX_VEC]; VipsImage **ivec; int n; int i; - if( (n = heap_get_imagevec( in, iivec, 100 )) < 0 ) + if( (n = heap_get_imagevec( in, + iivec, MAX_VEC )) < 0 ) return( FALSE ); g_value_init( out, VIPS_TYPE_ARRAY_IMAGE ); vips_value_set_array_image( out, n ); @@ -1916,10 +1917,11 @@ heap_ip_to_gvalue( PElement *in, GValue *out ) } else if( heap_is_realvec( in, &result ) && result ) { - double realvec[100]; + double realvec[MAX_VEC]; int n; - if( (n = heap_get_realvec( in, realvec, 100 )) < 0 ) + if( (n = heap_get_realvec( in, + realvec, MAX_VEC )) < 0 ) return( FALSE ); g_value_init( out, VIPS_TYPE_ARRAY_DOUBLE ); vips_value_set_array_double( out, realvec, n ); diff --git a/src/imageinfo.c b/src/imageinfo.c index 2abf10f8..14f70f92 100644 --- a/src/imageinfo.c +++ b/src/imageinfo.c @@ -720,7 +720,6 @@ imageinfo_proxy_add( Imageinfo *imageinfo ) */ g_assert( !imageinfo->proxy ); if( !(imageinfo->proxy = IM_NEW( imageinfo->im, Imageinfoproxy )) ) - if( !(imageinfo->proxy = IM_NEW( NULL, Imageinfoproxy )) ) return; imageinfo->proxy->im = imageinfo->im; imageinfo->proxy->imageinfo = imageinfo; diff --git a/src/ip.h b/src/ip.h index fcb06b56..6cfbbd46 100644 --- a/src/ip.h +++ b/src/ip.h @@ -108,7 +108,6 @@ #endif /*HAVE_SYS_STATVFS_H*/ #ifdef HAVE_SYS_VFS_H #include -extern int statfs(); #endif /*HAVE_SYS_VFS_H*/ #ifdef HAVE_SYS_MOUNT_H #include @@ -202,7 +201,7 @@ extern int statfs(); #define IP_NAME PACKAGE "-" VERSION #define MAX_LINELENGTH (120) /* Max chars we display of value */ #define MAX_RECENT (10) /* Number of recent items in file menu */ -#define NIP_COPYRIGHT "%s: ©2018 Imperial College, London" +#define NIP_COPYRIGHT "%s: ©2023 libvips.org" /* Our stock_ids. */ diff --git a/src/lex.l b/src/lex.l index db5d9935..b960b9b7 100644 --- a/src/lex.l +++ b/src/lex.l @@ -180,7 +180,7 @@ read_char( void ) /* Read string up to \n, EOF. */ - while( (ch = input()) != EOF && ch != '\n' ) + while( (ch = input()) != EOF && ch != '\n' && ch != '\0') ; } @@ -207,7 +207,7 @@ TRUE { BEGIN BINARY; yylval.yy_const.type = PARSE_CONST_BOOL; - yylval.yy_const.val.bool = TRUE; + yylval.yy_const.val.bol = TRUE; return( TK_CONST ); } @@ -216,7 +216,7 @@ FALSE { BEGIN BINARY; yylval.yy_const.type = PARSE_CONST_BOOL; - yylval.yy_const.val.bool = FALSE; + yylval.yy_const.val.bol = FALSE; return( TK_CONST ); } diff --git a/src/plot.c b/src/plot.c index 52b7b9cd..fb310939 100644 --- a/src/plot.c +++ b/src/plot.c @@ -375,7 +375,7 @@ plot_class_get( Classmodel *classmodel, PElement *root ) Imageinfo *ii2; IMAGE *t; DOUBLEMASK *mask; - int (*fn)(); + int (*fn)(VipsImage *, VipsImage *); /* nx1 or 1xm images only ... use Bands for columns. */ diff --git a/src/tree.h b/src/tree.h index 2b18ef2a..8a764bbb 100644 --- a/src/tree.h +++ b/src/tree.h @@ -126,7 +126,7 @@ struct _ParseConst { union { double num; char *str; - gboolean bool; + gboolean bol; int ch; } val; }; diff --git a/test/workspaces/test_conv.ws b/test/workspaces/test_conv.ws index c01bbe7f..29e6f5cc 100644 --- a/test/workspaces/test_conv.ws +++ b/test/workspaces/test_conv.ws @@ -1,7 +1,7 @@ - - - + + + @@ -96,7 +96,7 @@ - + @@ -147,7 +147,7 @@ - + @@ -230,7 +230,7 @@ - + @@ -289,7 +289,7 @@ - + @@ -305,7 +305,7 @@ - + @@ -356,7 +356,7 @@ - + @@ -407,7 +407,7 @@ - + @@ -485,7 +485,7 @@ - + @@ -556,9 +556,14 @@ + + + + + - + pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy