barnhill / barcodelib

C# Barcode Image Generation Library
Apache License 2.0
736 stars 239 forks source link

static DoEncode returns disposed Image #139

Closed Atomosk closed 1 year ago

Atomosk commented 2 years ago

Also calling Encode multiple times does not dispose previously generated image.

I think the _Encoded_Image field should be removed from the Barcode class. Methods like GetSizeOfImage and SaveImage are just facade on top of the Image and have nothing to do with barcode generation itself, so for a better backward compatibility they can be moved to an image extensions methods.

If those changes are ok, I can make a PR.

barnhill commented 2 years ago

I welcome all PRs. I'll review them as they come in.

barnhill commented 2 years ago

I agree with you that it should be removed. Ive removed it in a branch Im working on when I get a chance that refactors how the library draws and removes this image as there is no need to hold onto this image at all.

barnhill commented 1 year ago

Pull request is out with the changes to remove the _Encoded_Image and a massive refactor to remove usage of System.Drawing.Common which is not compatible with Linux and MacOS. https://github.com/barnhill/barcodelib/pull/152

This has taken a while to get out with job changes and all thats been going on. But this should be a much more compatible library now.