Commit Graph

42 Commits

Author SHA1 Message Date
Kleis Auke Wolthuizen 0337c09700
Cleanup gettext handling (#2695)
Use GLib's i18n support instead of copying and pasting that
logic into its own header. This deprecates the vips/intl.h
header in favour of glib/gi18n.h.
2022-02-27 15:27:28 +00:00
John Cupitt 3996f3279b fix range clips for casts to and from int
Fix two bugs:

- clip in casts from int32 and uint32 could overflow -- do these as gint64 now

- clip in casts from float to int could overflow since float32 can't
  represent the full range of int32 without losing precision -- do these
  as double

And add some more tests.

Thanks ewelot.

see https://github.com/libvips/libvips/issues/1922
2020-12-09 15:14:59 +00:00
John Cupitt 2265ad70a3 revise cast again
fixes saturated cast to integer
2020-05-11 11:42:12 +01:00
Kleis Auke Wolthuizen 7fecd79b0a Fix two compiler warnings 2020-05-01 09:46:26 +02:00
John Cupitt 834acad825 fix << on signed int warnings
<< on a negative number is undefined behaviour in C, and will trigger
fuzzer warnings.
2019-08-02 05:35:18 +01:00
John Cupitt d2f48a8875 remove a stray floor() from cast
thanks lovell
2019-01-12 13:51:35 +00:00
Lovell Fuller f815ec6801 Truncate rather than floor when casting from float to int 2019-01-11 18:09:20 +00:00
John Cupitt 07d58f81b3 fix cast on uint images
we could get sign and overflow mixed up for casts on uint images

see https://github.com/libvips/nip2/issues/74
2018-11-14 17:07:49 +00:00
Alistair Thomas 5bad0404c2 Update GObject annotations for libvips/conversion directory 2017-09-26 17:04:17 +01:00
John Cupitt 362c7efdfc argh reapply seq removal 2017-03-06 11:55:38 +00:00
John Cupitt e6b20cbd0f Revert "remove stalling"
This reverts commit 959f412380.
2017-02-27 10:26:32 +00:00
John Cupitt 959f412380 remove stalling 2017-02-21 15:03:15 +00:00
John Cupitt 2be0b97dce switch to g_warning()_/g_info()
we had vips_warn() and vips_info(), but they are a bit crappy ... switch
to g_warning() and g_info() instead

see https://github.com/jcupitt/libvips/issues/544
2017-01-03 15:52:27 +00:00
John Cupitt 524c395f01 tiny doc fixes 2016-10-07 13:31:06 +01:00
John Cupitt 1ae92bb15f make optional args into bullets
make docs easier to read
2016-05-02 10:12:37 +01:00
John Cupitt 25c3c49d1c better handling of cast+shift for non-int formats
before, im.cast(uchar, shift = true) where im was float and tagged as
rgb16 would not shift the image, since it's unclear how much to shift a float
type by

now we do two casts: first, we guess the numeric range from the
interpretation, so rgb16 would be ushort, so we cast float->ushort;
second, we cast to the target type and do the shift on the way

see https://github.com/jcupitt/libvips/issues/397

thanks apacheark
2016-03-01 11:31:54 +00:00
John Cupitt 07a1903390 use g_assert_not_reached()
we were using g_assert(0) ... g_assert_not_reached() makes the
intention clearer
2016-01-24 13:21:53 +00:00
John Cupitt a7d889df06 use builtin floor / ceil
get rid of FAST_PSEUDO_FLOOR, add VIPS_FLOOR and VIPS_CEIL, use them
everywhere

see https://github.com/jcupitt/libvips/pull/372
2016-01-23 09:50:57 +00:00
John Cupitt 244ab301f7 start final push for vips 8 2015-02-11 17:01:02 +00:00
John Cupitt 394149e9e8 fix all docs warnings 2014-11-17 10:32:40 +00:00
John Cupitt fb489bad53 move vips_image_decode() into the public API 2014-02-03 14:29:57 +00:00
John Cupitt affb274d85 more auto unpack hacking 2014-01-23 13:19:37 +00:00
John Cupitt 0bb052414a use plain "restrict"
configure changes this to __restrict__ for us, if the compiler supports
it
2013-12-03 08:53:36 +00:00
John Cupitt eb3ad6d64f add lots of instrumentation
also svg output
2013-11-26 14:57:56 +00:00
John Cupitt 5b7b3cb591 small fixes for clang static analyzer
a few small things clang static analyzer found
2013-11-22 14:34:13 +00:00
John Cupitt 12cf71a6a9 combin copy_fields and demand_hint
We had two API calls, vips_image_copy_fields() and vips_demand_hint().
They are now combined in the single vips_image_pipeline() call.

All operations are now slightly smaller and simpler.
2013-10-22 09:29:40 +01:00
John Cupitt 440b800e0e add a new unbuffered seq mode
things like

	vips copy huge.png x.v

now run with only a small line cache
2013-09-29 11:04:11 +01:00
John Cupitt 2fd2fd58f7 fix up gtk-doc
fix various problems:

- out of date IGNORE in doc/reference/Makefile.am
- name clashes between private .h and public
2013-06-17 20:16:20 +01:00
John Cupitt 27b7332a60 im_msb() -> class
and some cleanups

add a --band option
2013-06-03 10:26:09 +01:00
Benjamin Gilbert 8cc76a6ba3 Update address for Free Software Foundation
Also update LGPLv2.1 license text from the copy currently on the GNU
website.
2013-03-07 00:40:19 -05:00
John Cupitt 777d1ea554 better error domain names 2012-11-02 14:41:47 +00:00
John Cupitt 643dc28950 turn on seq mode automatically in cli
cli operations turn on seq mode automatically when they can

vips_operation_get_flags() added: lets you attach a set of flags to an
operation

flags for now are "nocache" (replacing the old nocache system) and "seqential"

if vips_object_set_argument_from_string() from string sees "seq" flag on the
object for which it is setting the arg, it enables sequential mode

all operations which can run sequentially have been tagged

the operation printer knows about flags and can display them
2012-07-10 10:51:40 +01:00
John Cupitt 7af1fb34d7 cast to unsigned int did not remove <0
previously cast to uint did nothing (since the positive range of uint is
greater than int), now it changes <0 values to 0
2012-04-10 14:26:41 +01:00
John Cupitt d0ec401a12 hackery to get goi working 2011-12-31 18:22:42 +00:00
John Cupitt a62f5f8832 remove wio_output 2011-12-21 12:08:29 +00:00
John Cupitt 187212768d add class for complex ops
and it does conj as well
2011-11-19 11:24:04 +00:00
John Cupitt 3b238d4e7e finish revising new docs 2011-11-18 14:34:33 +00:00
John Cupitt 5a73f0dede vector to ink is all new-style
final bit of vips7 api use removed from vips8 ops
2011-11-01 09:43:15 +00:00
John Cupitt 7807efcfbe remove some dbg 2011-10-29 20:59:32 +01:00
John Cupitt 441ae2305e sync 2011-10-28 17:36:20 +01:00
John Cupitt c027528b82 im_clip2fmt() redone as a class
plus some rationalisation of member names
2011-10-27 12:10:24 +01:00
John Cupitt 6402fd9487 start VipsCast 2011-10-26 21:56:05 +01:00