microsoft / Analysis-Services

Git repo for Analysis Services samples and community projects
MIT License
575 stars 402 forks source link

[FabricPS-PBIP] Export-FabricItems: PNG image files in ReportName.Report\StaticResources\RegisteredResources are corrupted #266

Open JamesDBartlett3 opened 1 week ago

JamesDBartlett3 commented 1 week ago

When a report is saved in PBIP format, all images embedded in that report are saved as PNG files in the ReportName.Report\StaticResources\RegisteredResources folder (adjacent to the .PBIP file).

When the report is saved locally by Power BI Desktop, these PNG files are valid image files, and they can be opened by any image viewer app. But when the report is exported from the Power BI service by Export-FabricItems, those same PNG files are corrupted, so they cannot be opened in any image viewer app.

image image

As a result, if the user opens a ReportName.Report\definition.pbir file that was exported with Export-FabricItems in Power BI Desktop, none of the embedded images will display properly, and if the user publishes that report from Power BI Desktop to the Power BI service, the embedded images will not display properly there either.

image image

The PNG files that were saved locally with Power BI Desktop are actually smaller than the ones that were exported with Export-FabricItems, so I think it's pretty likely that some extra bytes of data are being added to the files during the export process, and that is causing them to become corrupted. image

@RuiRomano, please let me know if I may be of any assistance with sorting this out.

RuiRomano commented 1 week ago

Thanks James, I'm looking into this. Not sure if its caused by the Fabric Get Definition API or my code.