Commit Graph

3675 Commits

Author SHA1 Message Date
Michael Natterer b1506229f9 plug-ins: change save procedures of the file-raw-data plug-in
The signature of the original file-raw-save procedure must not change,
so change it to use the old parameters.

Change the other procedure (with additional arguments) to
file-raw-save2.
2017-07-31 20:17:51 +02:00
SimaMoto,RyōTa 7da262d86f Bug 784836 - Context conflict on "Lower" in po-plug-ins. 2017-07-18 12:56:32 +02:00
Massimo Valentini f2306abc0a Bug 761170: Warnings building with clang
Fix some of the warnings.
2017-07-15 21:05:56 +02:00
Ben Touchette dc9856cfe1 Bug 769820 - Cannot enter Iptc information when no metadata is available...
...and fails to write it to file when it is

Completely redo metadata editor and viewer code, adds support for
Xmp.xmpMM.History and more.
2017-07-07 18:11:39 +02:00
Ell 98f7fc85ac plug-ins: in file-csource, add RLE support for RGB565
Currently, toggling RGB565 makes the RLE toggle insensitive, but
if RLE is checked beforehand RLE is used anyway, with incorrect
results.

Fix this by adding RLE support for RGB565 data.
2017-07-07 04:32:51 -04:00
Ell cd3ca47cc1 Bug 784462 - Export in C source format reports wrong BPP/buffer-size ...
... when using macros + RGB565
2017-07-07 04:32:50 -04:00
Michael Natterer 34485cff86 plug-ins: don't say for(int x...) in file-pcx.c 2017-06-29 18:39:41 +02:00
Jehan e2d1a57ebd plug-ins: fix comment explaining cairo_save().
Current comment was implying that PDF had some kind of fixed PPI, or
that a 72 PPI was hardcoded in cairo. This is not at all what this is
about. Cairo simply has a concept of user-space coordinates, and from
what I gather, it seems that this is set as "point", the typographical
unit of measure (not as a screen point). In such context, cairo_scale()
is used to update the transformation matrix (which will transform from
user to device units, i.e. pixels) so that we can draw with pixels. In
other words, both the user and device units will be pixels in subsequent
calls.
It turns out that 1 inch == 72 points. This is not a PPI/DPI at all and
the comment was completely misleading.
2017-06-20 00:44:03 +02:00
Jehan a2b438cc82 plug-ins: fill the background color inconditionally on full image size.
No need to loop through layers, which may be wrong anyway with
layers-as-pages. Also we were using the layer sizes without even
checking their offsets yet filling from (0, 0). This code was flawed in
many aspects.
2017-06-20 00:44:03 +02:00
Lionel N 4a05ddebab Export layers as pages to pdf / Reverse pages order
Added a "Reverse Order" option when "Layers as pages" is checked.
"Layers as pages" option is greyed out if the image has only 1 layer.
2017-06-19 22:16:00 +02:00
Jehan dd6dab113e Bug 783528 - PDF export ignores layer masks.
Cairo doc is pretty clear about cairo_mask_surface():
> A drawing operator that paints the current source using the alpha
> channel of @surface as a mask
Therefore when creating a mask surface, it must be in one of
CAIRO_FORMAT_* with an alpha channel and the mask data must be copied
into this alpha channel. I chose CAIRO_FORMAT_A8 (a format with alpha
only) which I map to "Y u8" babl format in GEGL so that
gegl_buffer_copy() copies the contents of Y into A.
2017-06-16 16:42:39 +02:00
Jehan 0bd94f172a plug-ins: properly "Apply layer masks before saving" when checked.
The `if` test was inverted. When the option is checked, we don't want to
add the GIMP_EXPORT_CAN_HANDLE_LAYER_MASKS capability so that
gimp_export_image() applies the mask.
This is a first step to fix bug 783528, but it's not finished. Right
now, when the option is unchecked, the mask is simply ignored. We want
to export a PDF mask instead.
2017-06-15 20:58:31 +02:00
Jehan 90219a0208 plug-ins: vectorize and apply-masks checked by default for PDF export.
They used to be TRUE by default but that was overwritten. This has been
fixed in commit c08cf41. Let's bring these defaults back.
2017-06-15 01:09:12 +02:00
Jehan c8550c9581 plug-ins: create file-pdf-save2 with the additional parameter.
And revert file-pdf-save to its previous signature before commit
d03de52. For compatibility reason, we can't change the signature of a
procedure available in previous stable releases.
Also revert file-pdf-save-multi for the same reason. I don't create a
file-pdf-save-multi2 though even though layers-as-pages could still be
meaningful there (creating a multi-page PDF from several multi-layers
images) but that's likely a special case which can be dealt with later.
Obviously the interactive export will use file-pdf-save2.
2017-06-15 00:48:06 +02:00
Jehan c08cf41113 plug-ins: only check non-defaut parameters in non-interactive mode.
Otherwise default values are not taken into account in interactive mode.
In particular, we want ignore-hidden to be checked (TRUE) by default,
because this is the most obvious behavior (WYSIWYG).
2017-06-15 00:39:54 +02:00
Lionel N d03de527a5 Bug 382688 - Export layers as pages to PDF file
Add feature to export multiple layers to multiple pages.
Fixed the deprecated functions.
Fixed how transparent/invisible layers are handled.
2017-06-15 00:39:45 +02:00
Jehan dc069e424a plug-ins: coding-style fix, adding comments and removing unused var.
Commits 8d4642f and daa5611 reviewed. I was only unsured on usage of
header vs EOF palette as well as the non-B&W monochrome palette since we
don't find a single authoritative spec. Nevertheless the implementer has
good argumentation so let's go with this. Simply I add some comments
about these 2 points in the code, just in case for future references.
2017-06-09 13:17:07 +02:00
Nikc M daa5611e6f Fix for Bug 159947 - saving 1bpp PCX files
+Allows user to save indexed 1bpp and 4bpp PCX files automatically,
depending on the number of colors used.

+Creates a general function with parameters for both bpp and # of
planes, to handle more PCX file types (1bpp, 2planes; 1bpp, 2planes;
4bpp, 1plane).

+Removes assumption when loading colormap that 1bpp files are black &
white only; loads both colors from PCX palette header instead.

https://bugzilla.gnome.org/show_bug.cgi?id=159947
2017-06-09 13:13:09 +02:00
Nikc M 8d4642f4ba Bug 159947 - saving 1bpp PCX Files
Allows saving 1bpp and 4bpp indexed PCX files based on number of colors
used in image. Also provides ability to load additional PCX formats:
2bpp, 2 planes 1bpp, 3 planes 1bpp, 4bpp.
2017-06-09 13:13:09 +02:00
Edward E d2de5a0c30 Bug 555777 - Export to MNG animation fails
Fix calling convention for libmng functions in file-mng plug-in.
2017-06-04 12:30:24 +02:00
Michael Natterer d0c1ae9b57 plug-ins: minor formatting stuff in wavelet-decompose 2017-04-21 22:27:18 -03:00
Tobias Stoeckmann 13ed12d2b3 plug-ins: avoid OOB write on malicious GIH files.
Integer overflows allow out of boundary writes while reading GIH files.

The checks are copied from file-gbr.c. In turn, the necessary gsize
casts are added in file-gbr.c, too. These are important on 64 bit
systems. Without these casts, the precision of the calculation is still
32 bit, allowing overflows.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2017-04-08 22:31:50 +02:00
Tobias Stoeckmann 10f12bdcbd PCX: Avoid segmentation fault with invalid file.
If a PCX file contains a bytesperline entry which is too small, it is
possible to trigger an out of boundary read, which can lead to a
segmentation fault.

The bytesperline validation is incomplete. While checking if enough
bytes per line exist, the integer truncation during the division must be
taken into account.

An example would be a 1x1 PCX file with a bpp of 1 (monochrome). The
current check allows a bytesperline field of 0, which in turn would lead
to a 0 byte allocation in load_1. Yet, the code would access index 0.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2017-04-08 17:25:07 +02:00
Tobias Stoeckmann 20c9b60487 PCX: Stop parsing an invalid file early on.
If either width or height is 0, gimp won't process the PCX file.
Instead, a bunch of error messages are printed.

It's nicer to quit parsing the file early on with a good error message
which is straight to the point instead.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2017-04-08 11:59:32 +02:00
Jehan bc344a9991 Bug 750180 - Fix different ways of writing Plug-in Plug-In Plugin.
It was agreed that we should write "plug-in" consistently. Only possibly
user-visible strings were updated.
Thanks to scootergrisen for a first patch which could not make it
after changing decision on the canonical writing.
2017-03-21 17:52:22 +01:00
Ell 03756d0980 app: rename "Color (HSV) (legacy)" mode to "Color (HSL) (legacy)"
The color-space qualification is, in fact, a 2.9 thing, so there's no
historic reason to keep the wrong name for the legacy mode.
2017-03-16 06:23:30 -04:00
Michael Natterer dda54c1df8 Deprecate stock items for good and change all icon defines to GIMP_ICON_*
Try to sort all GIMP_ICON_* defines into FDO categories like in
https://specifications.freedesktop.org/icon-naming-spec/latest/ar01s04.html

Add defines for all icons we override, rename some icons to their FDO
standard names, and mark the ones we duplicate with a comment so we
don't forget to rename those to standard names in 3.0.
2017-03-05 16:01:59 +01:00
Michael Natterer 3cf423f0cd *: rename NORMAL to NORMAL_LEGACY and NORMAL_LINEAR to NORMAL
and make NORMAL_LEGACY immutable.
2017-02-26 16:26:34 +01:00
Daniel P. Berrange ad9ccc4b58 Bug 778990 - PNM file plugin doesn't preserve 16-bit image precision
Save PNM in 16-bit format with max value of 65536 if the
image precision is not U8.
2017-02-22 12:52:33 +01:00
Daniel P. Berrange c87543aaac Bug 778990 - PNM file plugin doesn't preserve 16-bit image precision
Create a U16 precision image if loading a PNM file with
a max value greater than 255
2017-02-22 12:52:03 +01:00
Alexandre Prokoudine c3c895cd49 Slightly normalize wavelet-decompose metadata 2017-02-13 04:17:00 +03:00
Michael Natterer 801bd8fb3f plug-ins: get rid of icons in dialog buttons (use labels not stock IDs) 2017-02-12 16:18:54 +01:00
Jehan dd4848e680 plug-ins: headers only needed with the Sendmail-email plugin. 2017-02-02 21:41:15 +01:00
Michael Natterer c6f00eb87f app, menus, plug-ins: add new menu Color -> Tone Mapping
Move all related GEGL filters and the retinex plug-in there..
2017-02-02 20:42:58 +01:00
Simon Budig 884edf56ca libgimpbase: make GimpMetadata its own type derived from GExiv2Metadata 2017-01-30 16:43:59 +01:00
Thomas Manni 2733bfb1d5 plug-ins: link smooth-palette against GEGL
and add support for "gegl => 1" in plug-in-defs.pl
2017-01-23 12:54:05 +01:00
Miroslav Talasek 17fb208e1e Bug 777625 - Wavelet decompose plugin
Add wavelet decompose plug-in implemented from scratch.

Did some cleanup and added undo group and progress (mitch).
2017-01-23 02:05:24 +01:00
Øyvind Kolås d1fea4d6c6 png: add a combo-box for specifying png bitdepth/variant
When working in high bitdepth, manually changing precision to 8bit or 16bit is
an extraenous step, this adds a conversion step - but doesn't permit dithering
- and also doesn't permit using the palette modes of PNG. However it makes
workflows with single precision linear floating point much more usable.
2017-01-19 01:02:17 +01:00
Michael Natterer 152adbb1bd Rename GIMP_LAYER_MODE_FOO_BROKEN to GIMP_LAYER_MODE_FOO_LEGACY
"Broken" sounds like it needs fixing, but it's legacy compat stuff
that will have to stay for all eternity.
2017-01-09 01:27:20 +01:00
Michael Natterer 66060e3307 app, libgimp*, plug-ins: replace enum GimpLayerModeEffects by GimpLayerMode
with proper value names. Mark most values as _BROKEN because they use
weird alpha compositing that has to die. Move GimpLayerModeEffects to
libgimpbase, deprecate it, and set it as compat enum for GimpLayerMode.
Add the GimpLayerModeEffects values as compat constants to script-fu
and pygimp.
2017-01-08 23:00:19 +01:00
Ell 38c79600f1 metadata: fix a few memory leaks 2017-01-06 19:12:43 -05:00
Hartmut Kuhse 66bc98d299 Revert "New GimpMetadata as subclass of GExiv2Metadata"
This reverts commit 3ab08c8bfd.
2017-01-03 19:36:22 +01:00
Hartmut Kuhse 3ab08c8bfd New GimpMetadata as subclass of GExiv2Metadata 2017-01-03 19:26:35 +01:00
Michael Natterer 559a758581 Bug 776516 - Saving over existing GZ or BZ2 compressed files...
...does not truncate them

Pass O_TRUNC to g_open() when creating the target files.
2017-01-03 15:11:45 +01:00
Michael Schumacher 1ed5def8e7 Bug 728633 - Improvements to the file-raw plugin
Merge branch bug-728633 to introduce the file-data-raw changes.
2016-12-30 21:41:38 +01:00
Michael Schumacher 779649bdb7 Merge branch 'master' into bug-728633 2016-12-30 21:14:44 +01:00
Ell ce9e7feabd metadata: small fix 2016-12-30 14:49:59 -05:00
Ell 69adce4c75 metadata: don't truncate IPTC values
... since they're (theoretically) user-editable
2016-12-30 09:24:49 -05:00
Ell f8e291bf31 Bug 769112 - The metadata windows takes a lot of CPU.
Exif tags may have long values, which can choke GTK if we display
them in their entirety.  Truncate tag values (based on type, and
with proper indication) to avoid that.

This commit also hides private tags, and fixes some memory leaks.
2016-12-29 22:10:38 -05:00
Michael Schumacher b6e7d19e4f Merge branch 'master' into bug-728633 2016-12-26 20:01:06 +01:00