GithubHelp home page GithubHelp logo

ialoig / nodejs-png2svg Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 0.0 223 KB

Convert a PNG image to SVG passing from a RLE encoding ๐Ÿ”’๐Ÿง‘โ€๐Ÿ’ป

JavaScript 100.00%
encoding nodejs png-encoder rle-decoder rle-encoder svg

nodejs-png2svg's Introduction

Hi there ๐Ÿ‘‹ I'm Giovanni

A passionate Product Manager

  • ๐Ÿ”ญ Iโ€™m currently working on something coool

  • ๐ŸŒฑ Iโ€™m currently learning Solidity, Etherium VM, Blockchain

  • ๐Ÿ‘ฏ Iโ€™m looking to collaborate on React/ReactNative projects

  • ๐Ÿค Iโ€™m looking for help with Solidity

  • ๐Ÿ’ฌ Ask me about how to design/build a mobile/web app or Enterprise app

  • ๐Ÿ“ซ How to reach me [email protected]

  • โšก Fun fact In the free time I train my body and my brain ๐Ÿ‹๏ธโ€โ™€๏ธ ๐Ÿ“š

Languages and Tools

javascript Javascript reactnative React/ReactNative nodejs Node figma Figma java Java gatsby Gatsby rails Ruby ruby Ruby

ialoig

nodejs-png2svg's People

Contributors

ialoig avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

nodejs-png2svg's Issues

Error on cmd 'npm run export'

Found one error which is easy to correct. On my machine we run 'npm run export' and get the error of 'rleRow.split('#') is not a function'. This line of code is found in the decoder script. The error happens because rleRow is an array and not a string. By renaming rleRow to rleRowArray, and copying the characters of this array into a new string by name of 'rleRow' the output will then be correct since rleRow is now a string and now it has the string.split() function.

I made my edit inside the FOR loop of the function decode(). My FOR loop looks like this:

let rects = []
for (let row = 0; row < rleRows.length; row++) {
const /RENAMED to rleRowArray/ rleRowArray = rleRows[row] // ex : #ffffff32#0000004#ffffff28

	//TEMP FIX
	var rleRow = '';

	if(rleRowArray instanceof Array)
	{
			for(var x = 0; x < rleRowArray.length; x++)
			{
				rleRow += rleRowArray[x];
			}
	}

	//END TEMP FIX

	const rectsPerRow = generateRects(row, rleRow)
	rects.push(rectsPerRow)
}

Now, rleRow is a string and will work as expected.

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.