Coder Social home page Coder Social logo

pngcs's People

Contributors

andrew-raphael-lukasik avatar leonbloy avatar sungiant avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pngcs's Issues

Memory Management

There seems so be quite a lot of garbage being created when using these calls.

My use case.
I export 7 Large PNG's in succession or in parallel with async.
When I run the same process again the Mobile Version crashes due to memory issues.

This suggests that something is not properly discarded. Will run through code and see if I have any suggestions.

Index was outside the bounds of the array

I tried the following code and got this error.

IndexOutOfRangeException: Index was outside the bounds of the array.
Pngcs.PngWriter.EncodeRowFromInt (System.Int32[] row) (at Assets/pngcs-master/Pngcs/PngWriter.cs:270)
Pngcs.PngWriter.WriteRowInt (System.Int32[] newrow, System.Int32 rown) (at Assets/pngcs-master/Pngcs/PngWriter.cs:549)
Pngcs.PngWriter.WriteRow (Pngcs.ImageLine line, System.Int32 rownumber) (at Assets/pngcs-master/Pngcs/PngWriter.cs:530)
Pngcs.Unity.PNG.Write (UnityEngine.Color[] pixels, System.Int32 width, System.Int32 height, System.Int32 bitDepth, System.Boolean alpha, System.Boolean greyscale, System.String filePath) (at Assets/pngcs-master/Pngcs/Unity/Unity.cs:238)
Pngcs.Unity.PNG.Write (UnityEngine.Texture2D texture, System.String filePath) (at Assets/pngcs-master/Pngcs/Unity/Unity.cs:152)
PngcsTest+d__0.MoveNext () (at Assets/pngcs-master/PngcsTest.cs:15)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at /Users/builduser/buildslave/unity/build/Runtime/Export/Scripting/Coroutines.cs:17)

IEnumerator Start()
{
    yield return new WaitForEndOfFrame();

    var texture = ScreenCapture.CaptureScreenshotAsTexture();
    var output = Path.Combine(Application.persistentDataPath, "test.png");

    PNG.Write(texture, output);
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.