Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
## [2.1.9] - 2021-09-11
### Fixed
- Fixed Unity hang when importing certain PSD files (case 1357563)
  • Loading branch information
Unity Technologies committed Sep 11, 2021
1 parent 59f8cc1 commit afab78a
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
25 changes: 25 additions & 0 deletions Editor/PSDImporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1157,6 +1157,11 @@ internal T GetDataProvider<T>() where T : class
return this as T;
}

/// <summary>
/// Implementation for ISpriteEditorDataProvider.GetDataProvider.
/// </summary>
/// <typeparam name="T">Data provider type to retrieve.</typeparam>
/// <returns></returns>
T ISpriteEditorDataProvider.GetDataProvider<T>()
{
return GetDataProvider<T>();
Expand All @@ -1180,6 +1185,11 @@ internal bool HasDataProvider(Type type)
return type.IsAssignableFrom(GetType());
}

/// <summary>
/// Implementation for ISpriteEditorDataProvider.HasDataProvider.
/// </summary>
/// <param name="type">Data provider type to query.</param>
/// <returns>True if data provider is supported, false otherwise.</returns>
bool ISpriteEditorDataProvider.HasDataProvider(Type type)
{
return HasDataProvider(type);
Expand Down Expand Up @@ -1234,12 +1244,19 @@ internal void Apply()
EditorPrefs.SetBool("VerifySavingAssets", originalValue);
}

/// <summary>
/// Implementation for ISpriteEditorDataProvider.Apply.
/// </summary>
void ISpriteEditorDataProvider.Apply()
{
Apply();
}

internal void InitSpriteEditorDataProvider() {}

/// <summary>
/// Implementation for ISpriteEditorDataProvider.InitSpriteEditorDataProvider.
/// </summary>
void ISpriteEditorDataProvider.InitSpriteEditorDataProvider()
{
InitSpriteEditorDataProvider();
Expand All @@ -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]) };
}

/// <summary>
/// Implementation for ISpriteEditorDataProvider.GetSpriteRects.
/// </summary>
/// <returns>An array of SpriteRect for the current import mode.</returns>
SpriteRect[] ISpriteEditorDataProvider.GetSpriteRects()
{
return GetSpriteRects();
Expand Down Expand Up @@ -1321,6 +1342,10 @@ internal void SetSpriteRects(SpriteRect[] spriteRects)
}
}

/// <summary>
/// Implementation for ISpriteEditorDataProvider.SetSpriteRects.
/// </summary>
/// <param name="spriteRects">Set the SpriteRect data for the current import mode.</param>
void ISpriteEditorDataProvider.SetSpriteRects(SpriteRect[] spriteRects)
{
SetSpriteRects(spriteRects);
Expand Down
5 changes: 5 additions & 0 deletions Editor/PSDPlugin/PhotoShopFileType/PsdLoad.cs
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,10 @@ private static void SetPdnResolutionInfo(PsdFile psdFile, Document document)
/// </remarks>
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
Expand All @@ -296,6 +300,7 @@ internal static void CheckSufficientMemory(PsdFile psdFile)
{
throw new OutOfMemoryException();
}
*/
}
}
}
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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"
}
}

0 comments on commit afab78a

Please sign in to comment.