Commit Graph

95 Commits

Author SHA1 Message Date
Jehan e83ed61178 plug-ins: cleaning out some indentation tabs. 2016-11-03 23:02:19 +01:00
Matthias Junker-Petschick 3139cb9305 Bug 771558 - PSD files with a layer additional data length...
...not divisible by 4 are incorrectly reported as corrupt

file-psd: Do not round up the extra data length field when reading
layer info.

Fixes the PSD layer extra information handling in read_layer_info() by
not rounding up the data length field to a multiple of 4.

Layers can contain extra data, which is encoded at the end of layer
records. The length of this data should always be stored rounded up to
an even byte count. When loading a PSD file, it can be expected that
this value is already rounded up and this operation should not be
necessary. If an uneven byte count is encountered, a warning is
emitted but the loading process is not aborted.
2016-10-09 22:29:51 +02:00
Richard Kreckel dd9b0fc55b Bug 768044 - Fix many typos
This fixes many typos in comments and one in a user-visible string (msgid
"center abscisse" changed to "center abscissa" in affected po files. too).
2016-06-26 00:35:24 +02:00
Jehan 8a37c928eb app, plug-ins, libgimp*: clean out all remaining trailing spaces/tabs.
Rather than just discovering them by chance, a simple grep and some
search and replace are much more efficient! :-)
Cleaning only done on C and automake files.
2016-06-02 02:04:26 +02:00
Jehan ec27b539ea plug-ins: various s/save/export/ replacement on visible strings. 2016-02-16 02:35:43 +01:00
Massimo Valentini 32469d53b7 Bug 684295: wrong layer group structure in gimp 2.8.2...
... (read PSD file from PS CS3)

use a position of 0 when inserting normal layers
as they're always inserted on top of their group

-1 means inside the group when the active drawable is
a group or above it when it's not. This used to work
before layer groups or in simple cases.
2016-01-04 12:55:58 +01:00
Massimo Valentini e79632728d Bug 760029: PSD loader fails to load files with...
... adjustment or fill layers

the length of the compressed channel data was truncated
for the wrong type used in read_channel_data signature
2016-01-04 12:55:58 +01:00
Michael Natterer 67597f42ad Bug 754727 - gimp 2.9.1 git compilation fails in file-psd
Fix some glitches in patches I recently applied blindly :)
2015-09-08 18:54:02 +02:00
Julien Nabet 5a2757c6ec Bug 753986 - manage layer resource block lnsr
Layer name source (id on 4 characters encoded in MacRoman).
psd from PS>5 have "luni" (Layer Unicode)

See https://bugzilla.gnome.org/show_bug.cgi?id=753986#c4 for more details

Janitorial on lyvr:
move IFDBG at the beginning of the function
+change the content of it
2015-09-06 16:57:11 +02:00
Julien Nabet 8fb017342c Bug 753980 - manage layer resource block lyvr
Layer version appeared in PS7
Just warns if version is < 70 but nothing more
2015-08-23 13:51:05 +02:00
Michael Natterer 01df24c47e plug-ins: remove obsolete #defines from file-psd/psd.h 2015-08-20 11:26:59 +02:00
Michael Natterer 1d37c67879 plug-ins: use the GimpColorProfile API instead of the "icc-profile" parasite 2015-08-20 11:15:26 +02:00
ShadowKyogre 925ee21750 Bug 750594 - Colors in PSD files are far lighter on import and far darker on export
GIMP's PSD plugin was assuming that colors in PSD files are linearly interpolated
on both export and import. This commit fixes the issue by doing the following:

- when importing, assume the colors are gamma interpolated in the entire image
- when importing and exporting, treat the colors in each layer as gamma interpolated
- when importing and exporting, treat indexed colors as actually indexed colors
- when exporting, treat the interpolation in the channels and masks as linearly interpolated
2015-06-24 19:02:17 +02:00
Massimo Valentini 6138b58f14 file-psd: use correct size for high bit depth extra channels
it was missing a '* bps' in the size of data passed to GEGL
and the lower half of an extra-channel from a 16bit psd
appeared as garbage in GIMP
2015-06-19 18:58:39 +02:00
Massimo Valentini b07cf7fbee file-psd: improve high bit depth and compression support
see:
Bug 750729 - Importing *.PSDs with greater than
 8-bit depth lose their masks and appear funny
2015-06-13 18:33:00 +02:00
Michael Natterer 34c788d34e plug-ins: fix indentation of calls to read_channel_data() in psd-load.c 2015-05-01 16:36:51 -04:00
Michael Natterer c6ac3550d3 plug-ins: replace ">> 3" by "/ 8" in psd-load.c 2015-05-01 16:31:21 -04:00
Michael Natterer cf4cc504cf plug-ins: set G_LOG_DOMAIN in file-psd so it's possible to see the debug output 2015-05-01 16:19:52 -04:00
Michael Natterer bc4cf9918f Bug 673501 - Issue with Overlay
GIMP's OVERLAY mode was identical to SOFTLIGHT. This commit fixes the
issue and introduces a NEW_OVERLAY mode and enum value.

- change gimp:overlay-mode to be a real (svg-ish) overlay mode
- when compositing, map OVERLAY to gimp:softlight-mode
- when compisiting, map NEW_OVERLAY to gimp:overlay-mode
- bump the XCF version when NEW_OVERLAY is used
- map OVERLAY to SOFTLIGHT when loading and saving XCF
- map OVERLAY to softlight in all PDB setters
- map OVERLAY to softlight when deserializing a GimpContext
- change all paint mode menus to show an entry for NEW_OVERLAY
  instead of OVERLAY
- change PSP, PSD and OpenRaster to use NEW_OVERLAY

These changes should (redundantly) make sure that no OVERLAY enum
value is used in the core any longer because it gets mapped to
SOFTLIGHT at all entry points, with the downside of introducing a
setter/getter asymmetry when OVERLAY was set in a PDB api.
2015-04-29 13:32:58 -04:00
Michael Natterer 48618b88dc plug-ins: update file-psd/.gitignore 2015-04-26 15:50:13 -04:00
Michael Natterer 37c8e5602d plug-ins: merge file-psd-load and file-psd-save into one binary file-psd
which share the psd.c file for query() and run(), instead of having
save's stuff commented out in psd.c, and having it duplicated in
psd-save.c for the separate binary.
2015-04-26 15:37:31 -04:00
Michael Natterer 68ba2037c9 Bug 748488 - Unable to export to *.psd
Fix multiple small but crashing bugs:

- call gegl_init()
- gegl_buffer_get()'s scale must be 1.0 not 0
- don't unref the metadata object twice
2015-04-26 15:06:16 -04:00
Michael Natterer 3d3f1d6855 Bug 748487 - Thumbnails sometimes don't render correctly with *.PSD files
Using the right Babl format (JPEG previews don't have an alpha
channel), and fixing the main scanline loading loop (which was totally
busted) make the PSD previews look like images.
2015-04-26 13:31:01 -04:00
Massimo Valentini b42e764d9c Bug 698859: PSD import filter: opening a PSD file causes...
...file-psd-load segfault.

Fix loading of PSDs where the number of "end group" markers doesn't
match the number of "start group" markers, which seems to be what is
saved by Photoshop in some cases/versions/whatever.
2015-04-25 23:26:30 -04:00
Michael Natterer 9c5ef53c66 plug-ins: convert tabs to spaces in file-psd/psd-load.c 2015-04-25 23:20:00 -04:00
Michael Natterer 7c4f3f02c7 Bug 747156 - Gimp Development version crashes on processing masks from psds
Fix the other pixel format issue in this bug: split up
get_pixel_format() into 3 functions get_layer,channel,mask_format() so
we use the right one for the right drawable type, get_layer_format()
has an "alpha" parameter that is taken from the loaded layer instead
of from the PSDimage struct.
2015-04-25 23:02:54 -04:00
Michael Natterer 0d7d96d09f Bug 747156 - Gimp Development version crashes on processing masks from psds
Don't use the image's layer format to load layer mask and channels,
use a grayscale format instead.
2015-04-19 00:16:57 +02:00
Michael Natterer 3cda160fc1 plug-ins: the "icc-profile" parasite must be undoable 2015-04-18 23:57:10 +02:00
Simon Budig 7928be2255 fix a few potential use-before-check errors
Spotted by Andrey Karpov using static code analysis:
   http://www.viva64.com/en/b/0273/
2014-08-16 00:59:19 +02:00
Simon Budig 218b78241c fix errors in the psd loader code.
triggered by Andrey Karpov finding a stupid if-elseif-elseif-... sequence
using static code analysis:
   http://www.viva64.com/en/b/0273/
2014-08-16 00:37:14 +02:00
Michael Natterer f28878b6d3 plug-ins: start the progress before opening files for loading/saving
so the user gets feedback as early as possible.
2014-07-23 21:37:13 +02:00
Michael Natterer b5530e9e3d Use the new GeglAccessMode enum instead of the old values 2014-07-02 02:00:35 +02:00
Michael Natterer 3a4fedea7c libgimp: make gimp_image_metadata_save_prepare() suggest GimpMetadataSaveFlags
Return flags based on what metadata is actually present in the image.
Returning of a suggested value for GIMP_METADATA_SAVE_THUMBNAIL needs
support from gimp_image_metadata_load_prepare() and is still missing.

Port all plug-ins to use the new API, the suggested values are however
overridden by parasites and whatever special code was devised for the
individual plug-ins. This needs to be fixed.
2014-06-05 02:07:13 +02:00
Michael Natterer 425748dab0 libgimpbase, *: rename GimpFillType values: GIMP_FOO_FILL -> GIMP_FILL_FOO
Change all users accordingly and add compat enum values and compat
constants to script-fu and pygimp.
2014-06-03 01:11:32 +02:00
Michael Natterer 22c222291d libgimpbase,*: clean up enum values in gimpbaseenums.h
GIMP_ADD_foo_MASK -> GIMP_ADD_MASK_foo
GIMP_foo_MODE -> GIMP_BLEND_foo
GIMP_foo_CLONE -> GIMP_CLONE_foo
GIMP_foo -> GIMP_DODGE_BURN_TYPE_foo
GIMP_foo -> GIMP_TRANSFER_foo

Add compat values for the old names and compat code to script-fu
and pygimp.
2014-04-29 20:58:30 +02:00
Hartmut Kuhse 7b078a6e57 Bug 727832 - file-psd-load infinite loop
If a layer mask is completely outside the layer boundaries,
the layer mask is omitted
2014-04-21 19:25:18 +02:00
Michael Natterer eafe1b9be3 plug-ins: some general cleanup in file-psd (no code changes) 2014-02-09 19:38:19 +01:00
Simon Lui fd997447e5 plug-ins: merge soc-2013-psd branch, squashed into one commit
This ports PSD loading/saving to GEGL and adds parsing of more
PSD structs.
2014-02-09 19:16:05 +01:00
Michael Natterer 03df8c6af4 plug-ins: pass the format's name again in calls to gimp_export_image()
and clean up the formatting of the call and the lines around it. Now
we can check the various (disabled) export options for regressions
again by changing a single line in gimp_export_image().
2013-11-10 00:18:48 +01:00
Michael Schumacher 8db3b4312d Global EXIF -> Exif string change (official spelling) 2013-10-29 22:48:46 +01:00
Michael Natterer 940d615218 plug-ins: trust the PSD's resolution over its metadata's resolution 2013-10-27 19:01:22 +01:00
Michael Natterer a44e06d059 plug-ins: reverse the logic for setting GimpMetadataSaveFlags
start with flags = ALL (which now includes all possible current and
future flags), and optionally *remove* individual flags instead of
adding them. This way the plug-ins default to TRUE for future flags.
2013-10-27 15:38:42 +01:00
Michael Natterer 7cbe83d911 libgimp,plug-ins: split metadata loading into prepare() and finish()
So the plug-in has the chance to decide whether it wants to trust the
metadata information (e.g. resolution). Also reorder parameters in
gimp_image_metadata_save_finish(). Change all plug-ins accordingly.
2013-10-27 15:22:35 +01:00
Hartmut Kuhse 21bed1e2fb Completely rewrite metadata handling using gexiv2
Based on original patches from Hartmut Kuhse and modified
by Michael Natterer. Changes include:

- remove libexif dependency and add a hard dependency on gexiv2
- typedef GExiv2Metadata to GimpMetadata to avoid having to
  include gexiv2 globally
- add basic GimpMetadata handling functions to libgimpbase
- add image and image file specific metadata functions to libgimp,
  including the exif orientation image rotate dialog
- port plug-ins to use the new APIs
- port file-tiff-save's UI to GtkBuilder
- add new plug-in "metadata" to view the image's metadata
- keep metadata around as GimpImage member in the core
- update the image's metadata on image size, resolution and precision
  changes
- obsolete the old metadata parasites
- migrate the old parasites to new GimpMetadata object on XCF load
2013-10-27 01:02:17 +02:00
Clayton Walker 264d09b417 Rename colour and greyscale to color and grayscale respectively 2013-06-06 23:26:16 +02:00
Michael Natterer ec786816bb */Makefile.am: merge INCLUDES into AM_CPPFLAGS
automake-1.13 finally warns about this anachronism.
2013-06-05 20:48:37 +02:00
Ville Skyttä 6b0d1038cc Bug 692641 - Various spelling fixes 2013-01-27 18:59:02 +01:00
Michael Henning 0f6044ef2b plug-ins: fix memory leak in psd-save
Found using clang's scan-build.
2013-01-15 17:10:33 -05:00
Michael Natterer 890ae48330 Bug 686602 - missing EXIF_CFLAGS when building plug-ins/file-psd
Apply patch from John Hein which adds EXIF_CFLAGS to INCLUDES.
2012-10-22 14:59:51 +02:00
Øyvind Kolås d1ced11415 plug-ins: add GEGL_CFLAGS to many Makefile.am's 2012-05-02 17:46:08 +02:00