profile
viewpoint
Nano Miratus nnmrts @pumpncode Vienna, Austria pumpn.net he/him/his, making stuff and coding things

nnmrts/electron-react-bloatfree 15

A simple alternative to electron-react-boilerplate

nnmrts/badges 4

badges for everyone

nnmrts/plahoma 2

a tool to generate album cover placeholders for genius album pages

howtcode/data-file-vtf 1

convert to and from vtf files

nnmrts/eoe 1

geometry library

nnmrts/lapid 1

natural language generation and processing done right

lxender/translationhack 0

Repo for a little unofficial thing we made for Genius.

nnmrts/angular2-webpack-starter 0

:tada: An Angular Starter kit featuring Angular 4 (Router, Http, Forms, Services, Tests, E2E, Dev/Prod, HMR, Async/Lazy Routes, AoT via ngc), Karma, Protractor, Jasmine, Istanbul, TypeScript 2, TsLint, Codelyzer, Hot Module Replacement, @types, and Webpack 2 by @AngularClass

nnmrts/AngularSlideables 0

A "pure" Angular implementation of jQuery-style toggleSlide().

nnmrts/apng2webp 0

Convert apng (animated png's) to animated webp's

issue commenttl-dr-community/js-tldr

Setup PWA

Nice to hear! Sorry I couldn't continue to work on this, I was busy with a lot of other stuff the last few months.

RusinovAnton

comment created time in 20 days

startedw3c/webcomponents

started time in a month

startedrsms/inter

started time in a month

Pull request review commentsindresorhus/cli-spinners

Add some emoji love

 			"βββββρβ", 			"ββββββρ" 		]+	},+	"fingerDance": {+		"interval": 160,+		"frames": [+			"☝️",+			"✌️",+			"🤘",+			"🤟",+			"🖖",+			"🖐",+			"✋",+			"🤚",+			"👆"+		]+	},+	"fistBump": {+		"interval": 80,+		"frames": [+			"🤜    🤛",+			"🤜    🤛",+			"🤜    🤛",+			" 🤜  🤛",+			"  🤜🤛",+			" 🤜✨🤛",+			"🤜 ✨ 🤛"+		]+	},+	"soccerHeader": {+		"interval": 80,+		"frames": [+			" 🧑⚽️       🧑",+			"🧑  ⚽️      🧑",+			"🧑   ⚽️     🧑",+			"🧑    ⚽️    🧑",+			"🧑     ⚽️   🧑",+			"🧑      ⚽️  🧑",+			"🧑       ⚽️🧑 ",+			"🧑      ⚽️  🧑",+			"🧑     ⚽️   🧑",+			"🧑    ⚽️    🧑",+			"🧑   ⚽️     🧑",+			"🧑  ⚽️      🧑"+		]+	},+	"mindblown": {+		"interval": 160,+		"frames": [+			"😐",+			"😐",+			"😮",+			"😮",+			"😦",+			"😦",+			"😧",+			"😧",+			"🤯",+			"💥",+			"✨",+			"",+			"",+			""+		]+	},

Okay then :)

nnmrts

comment created time in a month

startedPotatoParser/vinyl

started time in a month

startedPotatoParser/ffmpeg-cli

started time in a month

startedvideojs/video.js

started time in a month

startedlinebender/runebender

started time in a month

Pull request review commentsindresorhus/cli-spinners

Add some emoji love

 			"βββββρβ", 			"ββββββρ" 		]+	},+	"fingerdance": {+		"interval": 160,+		"frames": [+			"☝️",+			"✌️",+			"🤘",+			"🤟",+			"🖖",+			"🖐",+			"✋",+			"🤚",+			"👆"+		]+	},+	"fistBump": {+		"interval": 80,+		"frames": [+			"🤜    🤛",+			"🤜    🤛",+			"🤜    🤛",+			" 🤜  🤛",+			"  🤜🤛",+			" 🤜✨🤛",+			"🤜 ✨ 🤛"+		]+	},+	"header": {+		"interval": 80,+		"frames": [+			" 🧑⚽️       🧑",+			"🧑  ⚽️      🧑",+			"🧑   ⚽️     🧑",+			"🧑    ⚽️    🧑",+			"🧑     ⚽️   🧑",+			"🧑      ⚽️  🧑",+			"🧑       ⚽️🧑",

Adding a test for constant width could be pretty hard, if not impossible. Look at this small example of the fingerDance spinner:

Kapture 2020-06-28 at 8 57 29

No matter which package or method I use, the number is never the same across all frames, even though visually every frame has the same width.

I used this code to log this btw:

<details> <summary>code</summary>

const logUpdate = require('log-update');
const cliSpinners = require('.');
const stringWidth = require("string-width");
const stringLength = require("string-length");

const spinner = cliSpinners[process.argv[2] || 'dots'];
let i = 0;

setInterval(() => {
	const {frames} = spinner;
	logUpdate(
		'\n' +
		frames[i = ++i % frames.length] + ' Unicorns' + 
		'\n' +
		'js length:\t\t' + frames[i].length +
		'\n' +
		'"string-width" length:\t' + stringWidth(frames[i]) +
		'\n' + 
		'"string-length" length:\t' + stringLength(frames[i])
	);
}, spinner.interval);

</details>

nnmrts

comment created time in a month

Pull request review commentsindresorhus/cli-spinners

Add some emoji love

 			"βββββρβ", 			"ββββββρ" 		]+	},+	"fingerdance": {+		"interval": 160,+		"frames": [+			"☝️",+			"✌️",+			"🤘",+			"🤟",+			"🖖",+			"🖐",+			"✋",+			"🤚",+			"👆"

Okay, so for some reason ☝️ and ✌️ are not shown in their "emoji form", in my shell at least. Removing them and adding a space after the 🖐 one fixed it for me.

Kapture 2020-06-28 at 8 02 44

nnmrts

comment created time in a month

Pull request review commentsindresorhus/cli-spinners

Add some emoji love

 			"βββββρβ", 			"ββββββρ" 		]+	},+	"fingerdance": {+		"interval": 160,+		"frames": [+			"☝️",+			"✌️",+			"🤘",+			"🤟",+			"🖖",+			"🖐",+			"✋",+			"🤚",+			"👆"

I couldn't try it out in my shell yet, but at least in the browser it looks fine, is this a shell-only thing, that different emoji have different width?

nnmrts

comment created time in a month

Pull request review commentsindresorhus/cli-spinners

Add some emoji love

 			"βββββρβ", 			"ββββββρ" 		]+	},+	"fingerDance": {+		"interval": 160,+		"frames": [+			"☝️",+			"✌️",+			"🤘",+			"🤟",+			"🖖",+			"🖐",+			"✋",+			"🤚",+			"👆"+		]+	},+	"fistBump": {+		"interval": 80,+		"frames": [+			"🤜    🤛",+			"🤜    🤛",+			"🤜    🤛",+			" 🤜  🤛",+			"  🤜🤛",+			" 🤜✨🤛",+			"🤜 ✨ 🤛"+		]+	},+	"soccerHeader": {+		"interval": 80,+		"frames": [+			" 🧑⚽️       🧑",+			"🧑  ⚽️      🧑",+			"🧑   ⚽️     🧑",+			"🧑    ⚽️    🧑",+			"🧑     ⚽️   🧑",+			"🧑      ⚽️  🧑",+			"🧑       ⚽️🧑 ",+			"🧑      ⚽️  🧑",+			"🧑     ⚽️   🧑",+			"🧑    ⚽️    🧑",+			"🧑   ⚽️     🧑",+			"🧑  ⚽️      🧑"+		]+	},+	"mindblown": {+		"interval": 160,+		"frames": [+			"😐",+			"😐",+			"😮",+			"😮",+			"😦",+			"😦",+			"😧",+			"😧",+			"🤯",+			"💥",+			"✨",+			"",+			"",+			""+		]+	},

I'm also not sure about that one tbh. Yeah, it's "just" emoji and "just" a cli-spinner, but it looks pretty graphic and insensible. I think the same about the already implemented "grenade" spinner btw.

nnmrts

comment created time in a month

push eventnnmrts/cli-spinners

Nano Miratus

commit sha c0d9935e56077ade2e4b1b0fdb1245df8c164d0c

rename some spinners

view details

push time in a month

Pull request review commentsindresorhus/cli-spinners

Add some emoji love

 			"βββββρβ", 			"ββββββρ" 		]+	},+	"fingerdance": {+		"interval": 160,+		"frames": [+			"☝️",+			"✌️",+			"🤘",+			"🤟",+			"🖖",+			"🖐",+			"✋",+			"🤚",+			"👆"+		]+	},+	"fistBump": {+		"interval": 80,+		"frames": [+			"🤜    🤛",+			"🤜    🤛",+			"🤜    🤛",+			" 🤜  🤛",+			"  🤜🤛",+			" 🤜✨🤛",+			"🤜 ✨ 🤛"+		]+	},+	"header": {

Alright, I'll change it to "soccerHeader".

nnmrts

comment created time in a month

push eventnnmrts/cli-spinners

Nano Miratus

commit sha 16bd1d90cc426e1d45793343a5cf7feb7724e801

ensure constant width on header spinner

view details

push time in a month

Pull request review commentsindresorhus/cli-spinners

Add some emoji love

 			"βββββρβ", 			"ββββββρ" 		]+	},+	"fingerdance": {+		"interval": 160,+		"frames": [+			"☝️",+			"✌️",+			"🤘",+			"🤟",+			"🖖",+			"🖐",+			"✋",+			"🤚",+			"👆"+		]+	},+	"fistBump": {+		"interval": 80,+		"frames": [+			"🤜    🤛",+			"🤜    🤛",+			"🤜    🤛",+			" 🤜  🤛",+			"  🤜🤛",

Hmmm, I'm really struggling with this one. Is there a unicode character for a space with the width of an emoji?

nnmrts

comment created time in a month

PR opened sindresorhus/cli-spinners

Add some emoji love

I played around with some emoji and emoji sequences, and this is the result.

+160 -0

0 comment

1 changed file

pr created time in a month

push eventnnmrts/cli-spinners

Nano Miratus

commit sha e2e99b21a94d1bf19cd39a5b8077dd8165ce41d0

Add some emoji love I played around with some emoji and emoji sequences, and this is the result.

view details

push time in a month

fork nnmrts/cli-spinners

Spinners for use in the terminal

fork in a month

startedsindresorhus/cli-spinners

started time in a month

startedpushshift/api

started time in a month

delete branch howtcode/data-file-vtf

delete branch : renovate/all

delete time in a month

push eventhowtcode/data-file-vtf

Renovate Bot

commit sha d8f101e8f5d2bbcaaedbd13a2f67b6ec8bd12e15

chore(deps): update dependency @pumpn/eslint-config to v6

view details

Nano Miratus

commit sha d820d98984665e38783aa4283407a9305470fac6

Merge pull request #11 from howtcode/renovate/all chore(deps): update dependency @pumpn/eslint-config to v6

view details

push time in a month

PR merged howtcode/data-file-vtf

chore(deps): update dependency @pumpn/eslint-config to v6 dependencies

This PR contains the following updates:

Package Type Update Change
@pumpn/eslint-config devDependencies major ^4.0.0 -> ^6.0.0

Release Notes

<details> <summary>pumpncode/eslint-config</summary>

v6.0.0

Compare Source

v5.0.2

Compare Source

  • revert: :bug: switched to cjs again 75ac332
  • chore: :arrow_up: update the babel preset 6869e05
  • refactor: :alembic: switch to es6 module 9b14078

v5.0.1

Compare Source

  • feat: :sparkles: add ignore patterns b24eb47

v5.0.0

Compare Source

  • feat: :sparkles: update some rules 043b3c2
  • chore: :heavy_minus_sign: remove eslint-plugin-flowtype 9795c0e
  • chore: :fire: remove flow annotations and rules 7d4e075
  • chore: :arrow_up: updated eslint, plugins, babel d2a9ed2

</details>


Renovate configuration

:date: Schedule: "before 3am on Monday" (UTC).

:vertical_traffic_light: Automerge: Disabled by config. Please merge this manually once you are satisfied.

:recycle: Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

:no_bell: Ignore: Close this PR and you won't be reminded about this update again.


  • [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

This PR has been generated by WhiteSource Renovate. View repository job log here.

+58 -49

0 comment

2 changed files

renovate[bot]

pr closed time in a month

startedplaycanvas/engine

started time in a month

push eventpumpncode/template

nnmrts

commit sha 5c481fb34a339c9cfe12521d37add114101ab572

fix: :bug: cjs stuff

view details

nnmrts

commit sha 1071709af0fe5474b36831ab12588b548e74a6c5

chore: :arrow_up: upgrade eslint config

view details

push time in 2 months

release pumpncode/eslint-config

v6.0.0

released time in 2 months

push eventpumpncode/eslint-config

nnmrts

commit sha 323e66bd4ff75dfbcc3a449d25710a458bdaa0da

fix: :bug: cjs stuff

view details

nnmrts

commit sha 4a3ce0a29b2851af6d3928a632065fd30c61c7bb

v6.0.0

view details

push time in 2 months

created tagpumpncode/eslint-config

tagv6.0.0

standard eslint config for pumpn code projects

created time in 2 months

create barnchpumpncode/template

branch : master

created branch time in 2 months

created repositorypumpncode/template

**the** repo template

created time in 2 months

MemberEvent

release pumpncode/eslint-config

v5.0.2

released time in 2 months

push eventpumpncode/eslint-config

nnmrts

commit sha 9b140786353fda92a7a1577f76755ae74ca1c6a8

refactor: :alembic: switch to es6 module

view details

nnmrts

commit sha 6869e05878364faa9f2b2ee491ead11f1fc09692

chore: :arrow_up: update the babel preset

view details

nnmrts

commit sha 75ac332bc93c9829e8099b67da38e13b6c27a110

revert: :bug: switched to cjs again doesn't work :(

view details

nnmrts

commit sha a091578f3c4de58186661d7098ee1250359707cc

v5.0.2

view details

push time in 2 months

created tagpumpncode/eslint-config

tagv5.0.2

standard eslint config for pumpn code projects

created time in 2 months

release pumpncode/babel-preset

v2.0.0

released time in 2 months

push eventpumpncode/babel-preset

nnmrts

commit sha 4123777d7d01b9011e6c647d330ed3ed5df6391e

fix: :heavy_plus_sign: add babel core and preset-env it doesn't work without it it works now

view details

nnmrts

commit sha 738f02143ff6ae30652001bc9cb576920db1661c

v2.0.0

view details

push time in 2 months

created tagpumpncode/babel-preset

tagv2.0.0

standard babel preset for pumpn code projects

created time in 2 months

release pumpncode/eslint-config

v5.0.1

released time in 2 months

created tagpumpncode/eslint-config

tagv5.0.1

standard eslint config for pumpn code projects

created time in 2 months

push eventpumpncode/eslint-config

nnmrts

commit sha b24eb47dbd8482db4cd543093096d72a5b617a3d

feat: :sparkles: add ignore patterns now vscode shouldn't freeze anymore when you open a big file in these directories

view details

nnmrts

commit sha e283456674fd6817c45e4e3148d77fa4e5ec0a55

v5.0.1

view details

push time in 2 months

GollumEvent

release pumpncode/babel-preset

v1.0.0

released time in 2 months

push eventpumpncode/babel-preset

nnmrts

commit sha 0e33c059a9b3e2bb51a0460903df531c735ccc32

fix: :ambulance: fix wrong main property why

view details

nnmrts

commit sha 75e4d1e29d6c92c1444c5f2f773849729c1865fd

chore: :see_no_evil: add gitignore file

view details

nnmrts

commit sha d996a51dc9100ce9186043b2fbacff54fe0eac78

feat: :sparkles: add and remove plugins bye bye flow, hello es proposals!

view details

nnmrts

commit sha 764cc68967e4229a5d7e1b803d1bca0d91245a2b

v1.0.0

view details

push time in 2 months

create barnchpumpncode/babel-preset

branch : master

created branch time in 2 months

created repositorypumpncode/babel-preset

standard babel preset for pumpn code projects

created time in 2 months

release pumpncode/eslint-config

v5.0.0

released time in 2 months

push eventpumpncode/eslint-config

nnmrts

commit sha d2a9ed21aea024c261068d8b34f2f605412fa099

chore: :arrow_up: updated eslint, plugins, babel

view details

nnmrts

commit sha 7d4e0754db86b4586d780a2fd88bc040d84231ff

chore: :fire: remove flow annotations and rules i don't use flow anymore so i removed it

view details

nnmrts

commit sha 9795c0e47895ff1fd1b5954ea2f8468c0b14dd81

chore: :heavy_minus_sign: remove eslint-plugin-flowtype

view details

nnmrts

commit sha 043b3c27936ef078b5c6bf7e56f93be573f23f16

feat: :sparkles: update some rules

view details

nnmrts

commit sha 6dfb4beb85a72596bf3710dba92497d6a75a373d

v5.0.0

view details

push time in 2 months

push eventhowtcode/data-file-vtf

nnmrts

commit sha f28218b6c8ef90cbe69fb2b39225b5e419a79798

refactor: :recycle: rename formats folder to data this is the beginning of thr restructuring process #3

view details

push time in 2 months

push eventhowtcode/data-compressed-bc

nnmrts

commit sha 471f0ccbcaef649b10af3e4e9dd8dd6ea20d7602

v0.10.0

view details

nnmrts

commit sha 4830bdd5a84e27545c996aa40187432017935a29

v0.10.1

view details

push time in 2 months

created taghowtcode/data-compressed-bc

tagv0.10.0

created time in 2 months

created taghowtcode/data-compressed-bc

tagv0.10.1

created time in 2 months

push eventhowtcode/data-compressed-bc

nnmrts

commit sha 08ab7b1ecae5e88e4c9bb4015d725f6270a0d580

renamed package

view details

nnmrts

commit sha 38d28070d356a74d87152a0d6b22451213024719

added id-length rule

view details

push time in 2 months

created repositoryhowtcode/data-file-vtf

created time in 2 months

startedvivaxy/png

started time in 2 months

startedlukeapage/pngjs

started time in 2 months

delete branch howtcode/vtf

delete branch : renovate/all

delete time in 2 months

push eventhowtcode/vtf

Renovate Bot

commit sha a82c30e6feb0377bcf92fcc7b2d2290a1bf40a0a

Update dependency jimp to ^0.13.0

view details

Nano Miratus

commit sha 58d9a6e7770c9695de4faef4083671b0cb19af32

Merge pull request #8 from howtcode/renovate/all Update dependency jimp to ^0.13.0

view details

push time in 2 months

PR merged howtcode/vtf

Update dependency jimp to ^0.13.0 dependencies

This PR contains the following updates:

Package Type Update Change
jimp dependencies minor ^0.12.1 -> ^0.13.0

Release Notes

<details> <summary>oliver-moran/jimp</summary>

v0.13.0

Compare Source

🚀 Enhancement
📝 Documentation
Authors: 2

</details>


Renovate configuration

:date: Schedule: "before 3am on Monday" (UTC).

:vertical_traffic_light: Automerge: Disabled by config. Please merge this manually once you are satisfied.

:recycle: Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

:no_bell: Ignore: Close this PR and you won't be reminded about this update again.


  • [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

This PR has been generated by WhiteSource Renovate. View repository job log here.

+200 -186

0 comment

2 changed files

renovate[bot]

pr closed time in 2 months

push eventhowtcode/vtf

nnmrts

commit sha 94c6e478a40a41887508722fbee3e1afe87396a0

added ow and is

view details

nnmrts

commit sha 77f1f00dfb15eaf420a906a924200db9bb0aa726

added first prototype of main function

view details

push time in 2 months

issue openedhowtcode/vtf

use sindresorhus/ow and sindresorhus/is for argument and type checking

looks nice, is up-to-date, let's use it

created time in 2 months

issue openedhowtcode/vtf

replace jimp and sharp with own functions

both, especially jimp, have their downfalls when it comes to performance and modernity, also sharp use libvips, so it's not pure javascript

  • [ ] jimp

    • [ ] discuss if we should definitely remove it
    • [ ] identify the parts we currently use
    • [ ] remove it from dependencies
  • [ ] sharp

    • [ ] discuss if we should definitely remove it
    • [ ] identify the parts we currently use
    • [ ] remove it from dependencies

created time in 2 months

issue commenthoovercj/vscode-power-mode

Help wanted: explosion gifs

This issue is a place to be happy. A place where you go after a long, stressful day, after you checked all those other issues. I always get a smile on my face after getting a notification from here. ❤️

hoovercj

comment created time in 2 months

issue commentdocumentationjs/documentation

can't use any other pipeline proposal syntax than "minimal"

I see. While I personally think that a user is responsible for managing their plugins and working out if they are supported by documentation.js, just like in this case I'm responsible for using the "right" pipeline syntax, because it breaks when I use other syntaxes, I also understand your perspective on this.

So, the fast, "now"-solution would be indeed to pass through just this option, I guess. I'd still suggest looking into a more generic solution in the future, or, at least some sort of documentation about the specific default babel configs documentation.js, and where and when it uses them.

Getting this error when running documentation.js

Primary Topic Reference found but pipelineOperator not passed 'smart' for 'proposal' option.

with a trace just to the @babel/parser package, and even though I passed "smart" for the "proposal" option, is weird and confusing.

nnmrts

comment created time in 2 months

pull request commentlovell/sharp

added uint8array as input and output option

oof, my approach actually doesn't work at all, because toBuffer can accept and return so different things...

I pretty much have to rewrite the _pipeline function from output.js to make this work.

nnmrts

comment created time in 2 months

issue commentdocumentationjs/documentation

can't use any other pipeline proposal syntax than "minimal"

Well, my personal plan of attack was to just switch to "minimal" because it's not that big of a difference.

But, yeah, I discovered that src/parsers/parse_to_ast.js file by accident, because I originally thought my local babel config is somehow not found or something. I thought it's just using the STANDARD_BABEL_CONFIG of src/input/dependency.js, but no. For some parts it's using my babel config, but later it breaks because it uses the babel config from src/parsers/parse_to_ast.js.

So I would just make the whole "standardBabelParserPlugins" dynamic, to make the whole thing future-proof. What if for example @babel/plugin-proposal-optional-chaining suddenly allows a new flavour option?

So in my opinion, this https://github.com/documentationjs/documentation/blob/78c6a5a72882e3ad7766a72a78a113d5a2980d4a/src/parsers/parse_to_ast.js#L37-L47

should look like this

function getParserOpts(file) {
  return {
    allowImportExportEverywhere: true,
    sourceType: 'module',
    plugins: [
      ...standardBabelParserPlugins,
      ...MYBABELCONFIG.plugins,
      ['decorators', { decoratorsBeforeExport: false }],
      TYPESCRIPT_EXTS[path.extname(file || '')] ? 'typescript' : 'flow'
    ]
  };
}
nnmrts

comment created time in 2 months

Pull request review commentlovell/sharp

added uint8array as input and output option

+'use strict';++const assert = require('assert');++const sharp = require('../../lib');+const fixtures = require('../fixtures');++describe('toUint8Array', () => {+  it('reusing same sharp object does not reset previously passed parameters to toUint8Array', (done) => {

Hm, so I probably should just search for every test that uses toBuffer and copy it but with Uint8Array, right?

nnmrts

comment created time in 2 months

Pull request review commentlovell/sharp

added uint8array as input and output option

 function toBuffer (options, callback) {   return this._pipeline(is.fn(options) ? options : callback); } +/**+ * Same as toBuffer, but writes output to a Uint8Array.+ *+ * @example+ * sharp(input)+ *   .toBuffer((err, data, info) => { ... });+ *+ * @example+ * sharp(input)+ *   .toUint8Array()+ *   .then(data => { ... })+ *   .catch(err => { ... });+ *+ * @example+ * sharp(input)+ *   .toUint8Array({ resolveWithObject: true })+ *   .then(({ data, info }) => { ... })+ *   .catch(err => { ... });+ *+ * @param {Object} [options]+ * @param {boolean} [options.resolveWithObject] Resolve the Promise with an Object containing `data` and `info` properties instead of resolving only with `data`.+ * @param {Function} [callback]+ * @returns {Promise<Buffer>} - when no callback is provided+ */+function toUint8Array (options, callback) {+  return new Promise((resolve, reject) => {+    this.toBuffer(options, callback).then((buff) => {+      resolve(Uint8Array.from(buff));

Same as what I said about the input, but I'll look into it and how to useArrayBuffer here.

I think there might be a lack of error handling here - what happens when toBuffer rejects?

Oh snap! Yep, I forgot to add that in my last commit, working on it.

nnmrts

comment created time in 2 months

Pull request review commentlovell/sharp

added uint8array as input and output option

+'use strict';++const assert = require('assert');++const sharp = require('../../lib');+const fixtures = require('../fixtures');++describe('toUint8Array', () => {+  it('reusing same sharp object does not reset previously passed parameters to toUint8Array', (done) => {

Alright, I'll look into that, although this test file is just a copy of the toBuffer.js test file. I don't fully understand the project and testing structure of sharp, so this will probably take me way longer than it would take anyone else with experience of sharp and/or unit tests of a big project, though.

nnmrts

comment created time in 2 months

Pull request review commentlovell/sharp

added uint8array as input and output option

 function _createInputDescriptor (input, inputOptions, containerOptions) {   if (is.string(input)) {     // filesystem     inputDescriptor.file = input;-  } else if (is.buffer(input)) {-    // Buffer-    inputDescriptor.buffer = input;+  } else if (is.uint8Array(input)) {+    // Buffer or Uint8Array+    inputDescriptor.buffer = Buffer.from(input);

About the copy/mutable thing: Yes, that's true, and I have to confess that I don't know a lot about "buffers" generally speaking, because I grew up with Javascript and not with languages where you actually have to deal with memory and buffers directly all the time. So the first time I came across the "Arraybuffer is just a reference" and "whatever you do to this buffer, also changes things in every reference buffer" kind of thing, it weirded me out, because most of the times things in Javascript don't behave like this. I get that sharing the same allocated memory is intended behaviour, but I still feel like it confuses more than it makes things faster/better. Look at this small example.

Yada yada yada, I think for sharp, and especially in this scenario, where sharp later passes that buffer on to libvips and then gives us back a new one, the whole copy/reference stuff is irrelevant. We are copying it/creating a new one anyway later on, afaik.

But, A, of course, you could still argue that using the underlying ArrayBuffer is more explicit and B, I often read that this has a lot to do with performance, so I guess using ArrayBuffer is faster? I don't know. But considering all of that, I'll look into how to use ArrayBuffer correctly here, so we don't make useless copies.

About the condition thing: Sure, I can do that if you really want, but as I said before, node's Buffer is just a subclass of Uint8Array, so this:

const input = Buffer.from([1,2,3,4]); // can be Buffer or uint8array

let result; // should be Buffer

if (input instanceof Buffer) {
	result = buffer;
}
else if (input instanceof Uint8Array) {
	result = Buffer.from(input.buffer);
}

is exactly the same as:

const input = Buffer.from([1,2,3,4]); // can be Buffer or uint8array

let result; // should be Buffer

if (input instanceof Uint8Array) {
	result = Buffer.from(input.buffer);
}

Using else if (is.uint8Array(input)) is probably easier to read/follow though, true.

nnmrts

comment created time in 2 months

push eventhowtcode/vtf

nnmrts

commit sha 6b5eb3259bafb5d85c452c788cecd2d8c558451a

changed schedule to weekly

view details

push time in 2 months

push eventhowtcode/vtf

nnmrts

commit sha 57d03b355da15c0d93bd28de1776beadf0d3a34f

moved and updated renovate config

view details

push time in 2 months

startedrenovatebot/renovate

started time in 2 months

delete branch howtcode/vtf

delete branch : renovate/configure

delete time in 2 months

push eventhowtcode/vtf

Renovate Bot

commit sha 8938d29fa8951d2d48218826931ea2289e3b7fd0

Add renovate.json

view details

Nano Miratus

commit sha 44edd5c46dc523932e5d25a155d7d6b6fe270548

Merge pull request #1 from howtcode/renovate/configure Configure Renovate

view details

push time in 2 months

PR merged howtcode/vtf

Reviewers
Configure Renovate enhancement

Welcome to Renovate! This is an onboarding PR to help you understand and configure settings before regular Pull Requests begin.

:vertical_traffic_light: To activate Renovate, merge this Pull Request. To disable Renovate, simply close this Pull Request unmerged.


Detected Package Files

  • package.json (npm)

Configuration Summary

Based on the default config's presets, Renovate will:

  • Start dependency updates only once this onboarding PR is merged
  • Separate major versions of dependencies into individual branches/PRs
  • Do not separate patch and minor upgrades into separate PRs for the same dependency
  • Upgrade to unstable versions only if the existing version is unstable
  • Raise PRs immediately (after branch is created)
  • If semantic commits detected, use semantic commit type <code>fix</code> for dependencies and <code>chore</code> for all others
  • Keep existing branches updated even when not scheduled
  • Disable automerging feature - wait for humans to merge all PRs
  • Ignore node_modules, bower_components, vendor and various test/tests directories
  • Autodetect whether to pin dependencies or maintain ranges
  • Rate limit PR creation to a maximum of two per hour
  • Limit to maximum 20 open PRs at any time
  • Group known monorepo packages together
  • Use curated list of recommended non-monorepo package groupings

:abcd: Would you like to change the way Renovate is upgrading your dependencies? Simply edit the renovate.json in this branch with your custom config and the list of Pull Requests in the "What to Expect" section below will be updated the next time Renovate runs.


You have configured Renovate to use branch master as base branch.

What to Expect

With your current configuration, Renovate will create 3 Pull Requests:

<details> <summary>Pin dependencies</summary>

</details>

<details> <summary>Update dependency jimp to ^0.13.0</summary>

  • Schedule: ["at any time"]
  • Branch name: renovate/jimp-0.x
  • Merge into: master
  • Upgrade jimp to ^0.13.0

</details>

<details> <summary>Update dependency rollup to v2.16.0</summary>

  • Schedule: ["at any time"]
  • Branch name: renovate/rollup-2.x
  • Merge into: master
  • Upgrade rollup to 2.16.0

</details>

<br />

:children_crossing: Branch creation will be limited to maximum 2 per hour, so it doesn't swamp any CI resources or spam the project. See docs for prhourlylimit for details.


:question: Got questions? Check out Renovate's Docs, particularly the Getting Started section. If you need any further assistance then you can also request help here.


This PR has been generated by WhiteSource Renovate. View repository job log here.

+5 -0

0 comment

1 changed file

renovate[bot]

pr closed time in 2 months

push eventhowtcode/vtf

nnmrts

commit sha 946346d436d41e3740f16aeda821f28117f5c89f

added node_modules folder to eslintignore

view details

nnmrts

commit sha 3e99bad2e207dd6812527c352f02ff2ea960292b

fixed invalid placeholder module code

view details

nnmrts

commit sha c3c97a862b85ecdb617bb0d0700ea5446d39ffbc

added documentation.js docs

view details

nnmrts

commit sha c8f8e5bcba71dd228059a7202cec98fa42e90616

switched to minimal pipeline syntax we have to wait until documentation.js fixes this

view details

push time in 2 months

issue openedhowtcode/vtf

clean up magic numbers

we have a lot of "magic numbers" in the code

the goal is to eliminate all of them by creating shared and private constants

created time in 2 months

startedsindresorhus/random-int

started time in 2 months

issue openeddocumentationjs/documentation

can't use any other pipeline proposal syntax than "minimal"

  • What version of documentation.js are you using?: 13.0.1
  • How are you running documentation.js (on the CLI, Node.js API, Grunt, other?): CLI

When I use syntax that requires the "fsharp" or "smart" pipeline proposal, documentation throws with a babel parser error

Primary Topic Reference found but pipelineOperator
not passed 'smart' for 'proposal' option.

even though I did exactly that. The issue is that src/parsers/parse_to_ast.js overwrites my babel config with ['pipelineOperator', { proposal: 'minimal' }].

created time in 2 months

issue closedhowtcode/vtf

look into rollup-awesome and add plugins

add every rollup plugin that seems useful and fun, we can care about optimization later

closed time in 2 months

nnmrts

issue commenthowtcode/vtf

look into rollup-awesome and add plugins

added progress, notify, visualizer, clear and filesize plugin, should be enough

nnmrts

comment created time in 2 months

push eventhowtcode/vtf

nnmrts

commit sha 2c1f97e698acd80fd9c9a567b9455e9280496d37

added some rollup plugins

view details

push time in 2 months

pull request commentlovell/sharp

added uint8array as input and output option

dunno why those checks are failing, did i do something wrong?

nnmrts

comment created time in 2 months

push eventhowtcode/sharp

nnmrts

commit sha d1359886318c64c4ebcf187729a093f711afb435

added missing semicolon

view details

push time in 2 months

PR opened lovell/sharp

added uint8array as input and output option

maybe dirty, but also simple and does the job (AFAIK)

should "fix" parts of #1315, discussion also in #1289

+64 -3

0 comment

4 changed files

pr created time in 2 months

push eventhowtcode/sharp

nnmrts

commit sha 742886c4059c82161ea7e63c83512045efef1ebb

added uint8array as input and output option

view details

push time in 2 months

startedEugeny/terminus

started time in 2 months

startedbndw/wifi-card

started time in 2 months

startedr-spacex/SpaceX-API

started time in 2 months

startedtobspr/shapez.io

started time in 2 months

issue openedhowtcode/vtf

look into rollup-awesome and add plugins

add every rollup plugin that seems useful and fun, we can care about optimization later

created time in 2 months

issue commentlovell/sharp

Enhancement: Include channel bit depth in raw constructor options.

@lovell Thanks! I already do it like that in my codebase. What I'm saying is, #1315 was my "original" issue, but it redirected me to this issue, even though I don't think this issue is a dependency to the other one, #1315. I hope this comment isn't considered as off-topic, I just didn't want to necromance that other issue.

#1315's OP and my point was, it would be nice being able to write

const uint8Array = Uint8Array.from([1,2,3,4]);

const resizedUint8Array = await sharp(uint8Array, {
  raw: { width: 32, height: 32, channels: 4 }
})
.resize(16)
.toUint8Array();

instead of

const uint8Array = Uint8Array.from([1,2,3,4]);

const bufferOfThat = Buffer.from(uint8Array);

const resizedBuffer = await sharp(bufferOfThat, {
  raw: { width: 32, height: 32, channels: 4 }
})
.resize(16)
.toBuffer();

const resizedUint8Array = Uint8Array.from(resizedBuffer);

before we/you figure out how different bit depths should be handled. The "problem" is that

  • input.js uses is.buffer https://github.com/lovell/sharp/blob/9431029917dcbb58f1a9302d7da090a5cf358973/lib/input.js#L31,
    • which uses instanceof Buffer https://github.com/lovell/sharp/blob/9431029917dcbb58f1a9302d7da090a5cf358973/lib/is.js#L48
  • and input.js uses Buffer.concat https://github.com/lovell/sharp/blob/9431029917dcbb58f1a9302d7da090a5cf358973/lib/input.js#L187
    • which is a node-specific static method and isn't really required here, because it only gets one input, at which point it could just use Buffer.from, which is not node-specific, or even better, Uint8Array.from.

Either is.buffer (which would probably renamed then) should use instance of Uint8Array, which would work for node Buffers too, because they are a subclass of Uint8Array.

Or the input should, as soon as we detect it's instance of Uint8Array, coerced to Buffer by using Buffer.from.

The input accepting Uint8Array would already be nice enough, but adding toUint8Array method as well would be perfect. That way, a user of sharp can choose by themself if they work with Uint8Arrays or Buffers. In my case, for my random project, I chose to solely use Uint8Array because it allows me to use new Uint8Array(), while new Buffer() is a security issue in node. Sure, Buffer.from works too, but in my opinion doesn't communicate well that you actually want to create a "new" Buffer. <hr> What I wrote above about Buffer.concat can be ignored though, as it accepts Uint8Arrays as well anyways.

andrew-higgins-4d

comment created time in 2 months

startedhowtcode/vtf

started time in 2 months

push eventhowtcode/vtf

nnmrts

commit sha d680151f678579f113222594826ebea846117b41

a lot of stuff

view details

push time in 2 months

issue openedhowtcode/vtf

restructure folders

currently the whole project structure is messy and it will only get worse and harder to fix, the later i begin restructuring it

created time in 2 months

issue openedhowtcode/vtf

netpbm support

  • [ ] file header
  • [ ] formats
    • [ ] pbm
    • [ ] pgm
    • [ ] ppm
    • [ ] pam

created time in 2 months

issue commentlovell/sharp

Enhancement: Include channel bit depth in raw constructor options.

I would also like to know the current state of this. Being able to use a Uint8Array or a Uint8ClampedArray would be a game-changer for me, and honestly, although it could be in the scope of this issue, I don't think it should be.

The input could just be "coerced" to the node.js Buffer by using Buffer.from. Or is that not a viable option?

andrew-higgins-4d

comment created time in 2 months

created taghowtcode/compression-bc

tagv0.9.2

created time in 2 months

push eventhowtcode/compression-bc

nnmrts

commit sha 44c430c8c3031ee46a8e8bcfc696802c5c1618cd

try again in 2021 when babel v8 is here

view details

nnmrts

commit sha 9de60701370b4114d07d047942c605a0a39e2a0c

cool newline m8

view details

nnmrts

commit sha c80a0a39201d453cf39f21ba98462c95d7148d5b

v0.9.2

view details

push time in 2 months

more