Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DYN-6808-NodeIcons-P4-P5-P6 Automatic Process #15283

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/DynamoCoreWpf/Views/Debug/UpdateNodeIconsWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,16 @@ private bool UpdateResxFile(NodeIconMetadata item, XDocument resx)
var oldElement = resxItems.Where(x => x.Attribute("name").Value.ToLower().Equals((item.IconName + "." + item.IconSuffix).ToLower())).FirstOrDefault();
if (oldElement != null)
{
var currentElementValue = oldElement.Descendants("value").FirstOrDefault().Value;
if (currentElementValue.ToLower().Contains(".png") || currentElementValue.ToLower().Contains(".jpg"))
{
//If the resx file is referencing a png image then we need to update/add the type and mimetype attributes
XAttribute attRemove = oldElement.Attribute("type");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zeusongit I thought you mentioned there is no resx file referencing a legacy png, maybe I got it wrong?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@QilongTang I've found 4 entries in DSCoreNodesImages.resx that are referencing the png image directly (without using base64).

<value>Resources\DSCore.Data.ParseJSON.Large.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@QilongTang I was wrong, there were 2 icons which were still using the png, we discussed this in slack, roberto will remove these icons after updating them to b64.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just commited a change for removing the png files
6c591c4

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, then the logic here is more for future proofing when things goes wrong from my understanding.

attRemove.Remove();
oldElement.SetAttributeValue("type", "System.Drawing.Bitmap, System.Drawing");
oldElement.SetAttributeValue("mimetype", "application/x-microsoft.net.object.bytearray.base64");
}

oldElement.Descendants("value").FirstOrDefault().Value = IndentBase64String(item.Icon_Base64String);
resx.Save(item.IconResxFile);
WritetoLogFile(logFile, "Updated: " + item.NewIconPath);
Expand Down
6 changes: 0 additions & 6 deletions src/Libraries/CoreNodes/CoreNodes.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,6 @@
<DependentUpon>Resources.en-US.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="Resources\DSCore.Data.StringifyJSON.Small.png" />
<None Include="Resources\DSCore.Data.StringifyJSON.Large.png" />
<None Include="Resources\DSCore.Data.ParseJSON.Small.png" />
<None Include="Resources\DSCore.Data.ParseJSON.Large.png" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
Expand Down
24,643 changes: 22,281 additions & 2,362 deletions src/Libraries/CoreNodes/DSCoreNodesImages.resx

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1,583 changes: 1,439 additions & 144 deletions src/Libraries/DesignScriptBuiltin/DesignScriptBuiltinImages.resx

Large diffs are not rendered by default.

50,476 changes: 43,663 additions & 6,813 deletions src/Libraries/GeometryUIWpf/ProtoGeometryImages.resx

Large diffs are not rendered by default.

Loading