pngcs icon indicating copy to clipboard operation
pngcs copied to clipboard

PCL profile 111 version of PNGCS

Open anders9ustafsson opened this issue 9 years ago • 3 comments

Dear Hernan,

Many thanks for an impressive work with this library!

Please find this pull request providing a separate solution containing a PCL profile 111 class library of pngcs, and a version of SamplesTests (.NET 4.5) that reference the PCL library.

Profile 111 means that the following platforms can be targeted:

  • .NET 4.5 and higher
  • Windows 8 and higher
  • Windows Phone 8.1 (non-Silverlight)
  • Xamarin Android
  • Xamarin iOS Unified API
  • Xamarin iOS Classic API

Thus, this pull request also resolves issue #4.

In all honesty, I have not been able to fully run the samples application, since I could not locate the test suite, so the PCL library is still untested.

The main differerence between the .NET (4.5) and the PCL library is that FileHelper has been omitted from the PCL project. A user of the PCL library thus have to replace the FileHelper calls with their platform equivalents when the PCL library is invoked.

I have made some bug fixes that are not related to PCL. I have as much as possible tried to make specific commits for each sub-issue, so it should be fairly straightforward from each individual commit which changes that have an impact on the original .NET project.

I have used compiler directive PORTABLE where I have found it useful to provide different implementations for the .NET-only and the PCL library.

Please let me know if you have any concerns with this pull request.

Thanks in advance!

Anders Gustafsson Cureos AB

PS. The portable solution is intended for Visual Studio 2013 and higher. The cost-free Visual Studio 2013 Community version should be sufficient.

anders9ustafsson avatar May 29 '15 10:05 anders9ustafsson

Hi anders9ustafsson,

I was trying out your updates to the library but I'm running into the issue that all images appear black. Take for example this test using the test files included in the project:

SampleCreateOrange.Create("test.png", 500, 500);

Any clue why this could be?

devedse avatar Apr 30 '16 01:04 devedse

Ah I found the issue. In the Png.End method the Dispose function was called on the datDeflateStream. This however never calls the Close method internally (since it's not overriden from the Stream class).

After manually calling that close method it now works. This should be fixed a bit nicer though.

devedse avatar Apr 30 '16 11:04 devedse

#I fixed some issues on your code, please see my pull request :).

devedse avatar May 01 '16 12:05 devedse