From afab78aa195c0e87c8b74fd644c8d7fab44bef89 Mon Sep 17 00:00:00 2001 From: Unity Technologies <@unity> Date: Sat, 11 Sep 2021 00:00:00 +0000 Subject: [PATCH] com.unity.2d.psdimporter@2.1.9 ## [2.1.9] - 2021-09-11 ### Fixed - Fixed Unity hang when importing certain PSD files (case 1357563) --- CHANGELOG.md | 4 +++ Editor/PSDImporter.cs | 25 +++++++++++++++++++ Editor/PSDPlugin/PhotoShopFileType/PsdLoad.cs | 5 ++++ package.json | 10 ++++---- 4 files changed, 39 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c7c04cc..13ff4ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## [2.1.9] - 2021-09-11 +### Fixed +- Fixed Unity hang when importing certain PSD files (case 1357563) + ## [2.1.8] - 2021-05-11 ### Changed - Update 2D Animation dependency diff --git a/Editor/PSDImporter.cs b/Editor/PSDImporter.cs index 630402a..ff192b8 100644 --- a/Editor/PSDImporter.cs +++ b/Editor/PSDImporter.cs @@ -1157,6 +1157,11 @@ internal T GetDataProvider() where T : class return this as T; } + /// + /// Implementation for ISpriteEditorDataProvider.GetDataProvider. + /// + /// Data provider type to retrieve. + /// T ISpriteEditorDataProvider.GetDataProvider() { return GetDataProvider(); @@ -1180,6 +1185,11 @@ internal bool HasDataProvider(Type type) return type.IsAssignableFrom(GetType()); } + /// + /// Implementation for ISpriteEditorDataProvider.HasDataProvider. + /// + /// Data provider type to query. + /// True if data provider is supported, false otherwise. bool ISpriteEditorDataProvider.HasDataProvider(Type type) { return HasDataProvider(type); @@ -1234,12 +1244,19 @@ internal void Apply() EditorPrefs.SetBool("VerifySavingAssets", originalValue); } + /// + /// Implementation for ISpriteEditorDataProvider.Apply. + /// void ISpriteEditorDataProvider.Apply() { Apply(); } internal void InitSpriteEditorDataProvider() {} + + /// + /// Implementation for ISpriteEditorDataProvider.InitSpriteEditorDataProvider. + /// void ISpriteEditorDataProvider.InitSpriteEditorDataProvider() { InitSpriteEditorDataProvider(); @@ -1252,6 +1269,10 @@ internal SpriteRect[] GetSpriteRects() return spriteImportMode == SpriteImportMode.Multiple ? spriteImportData.Skip(skip).Select(x => new SpriteMetaData(x) as SpriteRect).ToArray() : new[] {new SpriteMetaData(spriteImportData[0]) }; } + /// + /// Implementation for ISpriteEditorDataProvider.GetSpriteRects. + /// + /// An array of SpriteRect for the current import mode. SpriteRect[] ISpriteEditorDataProvider.GetSpriteRects() { return GetSpriteRects(); @@ -1321,6 +1342,10 @@ internal void SetSpriteRects(SpriteRect[] spriteRects) } } + /// + /// Implementation for ISpriteEditorDataProvider.SetSpriteRects. + /// + /// Set the SpriteRect data for the current import mode. void ISpriteEditorDataProvider.SetSpriteRects(SpriteRect[] spriteRects) { SetSpriteRects(spriteRects); diff --git a/Editor/PSDPlugin/PhotoShopFileType/PsdLoad.cs b/Editor/PSDPlugin/PhotoShopFileType/PsdLoad.cs index 9b93e4d..74ab19d 100644 --- a/Editor/PSDPlugin/PhotoShopFileType/PsdLoad.cs +++ b/Editor/PSDPlugin/PhotoShopFileType/PsdLoad.cs @@ -273,6 +273,10 @@ private static void SetPdnResolutionInfo(PsdFile psdFile, Document document) /// internal static void CheckSufficientMemory(PsdFile psdFile) { + /* + Remove memory check since we can't properly ensure there will + be enough memory to import + // Multichannel images have channels converted to layers var numLayers = (psdFile.ColorMode == PsdColorMode.Multichannel) ? psdFile.BaseLayer.Channels.Count @@ -296,6 +300,7 @@ internal static void CheckSufficientMemory(PsdFile psdFile) { throw new OutOfMemoryException(); } + */ } } } diff --git a/package.json b/package.json index 1a6488b..b101d04 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "com.unity.2d.psdimporter", - "version": "2.1.8", + "version": "2.1.9", "unity": "2019.4", "unityRelease": "0b11", "displayName": "2D PSD Importer", @@ -13,18 +13,18 @@ "category": "2D", "dependencies": { "com.unity.2d.common": "2.1.0", - "com.unity.2d.animation": "3.2.9", + "com.unity.2d.animation": "3.2.13", "com.unity.2d.sprite": "1.0.0" }, "relatedPackages": { - "com.unity.2d.psdimporter.tests": "2.1.8" + "com.unity.2d.psdimporter.tests": "2.1.9" }, "upmCi": { - "footprint": "805674b13206a30a97f2617cae728dda69d81647" + "footprint": "cb30cdb0e6e9cd8458d6f9be1d58191062b5f918" }, "repository": { "url": "https://github.cds.internal.unity3d.com/unity/2d.git", "type": "git", - "revision": "d18b9b4d93d8177094afe5dd128cf846cb1f0f4e" + "revision": "ff5113572ce6bc283f75b25349ccec9f1ea17bd6" } }