Bug 25058 - SignaturePad saves blank signature image when using the Bitmap.CompressFormat.Jpeg method & encoding to base64string; same approach works with Bitmap.CompressFormat.Png
Summary: SignaturePad saves blank signature image when using the Bitmap.CompressFormat...
Status: RESOLVED ANSWERED
Alias: None
Product: Components
Classification: Xamarin
Component: Xamarin Components ()
Version: Staging (addons.xamstage.com)
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bill Holmes
URL:
Depends on:
Blocks:
 
Reported: 2014-12-03 21:16 UTC by Kent Green [MSFT]
Modified: 2015-12-15 18:17 UTC (History)
1 user (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED ANSWERED

Description Kent Green [MSFT] 2014-12-03 21:16:34 UTC
---Overview---
From this desk case:
https://xamarin.desk.com/agent/case/108952

Customer reports that when trying to save signature using the Bitmap.CompressFormat.Jpeg method & compress it to a base 64 string; upon uncompressing it back to a jpeg the image is blank. They report that using the same approach with the Bitmap.CompressFormat.Png method works as expected.

Testing by modifying the SignaturePad Android sample, I was able to confirm that the customer's approach for compressing the bitmap appears to be valid; as in testing both with the jpeg and png I verify that they were being allocated to the heap in the Application Output dialog.

Since the compression approach is from a customer sample, I'm attaching my repo of the compression approach they used as a private attachment labeled "compression sample" shortly. 

I wasn't sure about the approach they used for decompressing the images back to jpeg / pngs respectively; so I'm requesting that info as well as the log files / version info from the customer.
Comment 2 Kent Green [MSFT] 2014-12-04 11:27:52 UTC
Customer reports that the problem was they needed to force the background of the signature bitmap to be white. 

If you don't do this the background is transparent which defaults to black when you convert a png to a jpg or eps which don't have alpha. So using this setting:

var bitmap = SignaturePadView.GetImage(Color.Black, Color.White);

As such, I've marked the case SupportDocs in case this could be more clearly described.
Comment 3 David Humphreys 2015-12-15 18:17:11 UTC
Resolved in docs