Code Monkey home page Code Monkey logo

ghostline's Introduction

DotMH

Martin AKA DotMH

wakatime

Anime, Manga, Videogames, JPOP & Music Fan. Inspired by Japan, Korea, SciFi, Sci & Cyberpunk. Web Developer & Designer

Top Langs

๐Ÿ‘จโ€๐Ÿ’ป Technology

Typescript Javascript Ruby PHP

Node NPM PNPM SASS Vite Terraform Jest Docker

React Next JS Astro

Figma Sketch

AWS AWS Lambda Netlify

Spotify Apple Music

macOS Rocky Linux Manjaro Ubuntu Windows 11

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

Mostly building with Javascript for Web, Server, Desktop and Mobile. Interested in Audio, Serverless, IoT / Raspberry PI.

๐ŸŒฑ Iโ€™m currently learning

I am constantly learning and trying new technologies. Some of the things that I am playing with are

Go Kubernetes

ghostline's People

Contributors

dotmh avatar

Watchers

 avatar

ghostline's Issues

Add Tests

Add tests to cover all plugin functionality

Swap to using direct load for node-vibrant in image colors

Currently the way the plugin works is it reloads the file in node-vibrant this is because that is the only documented way to do it. However you can actual directly load a buffer into node-vibrant.

i..e

const palette = await colors.from(<BUFFER>).getPalette();

This would be an improvement as we would already have the file contents in a Buffer from Metalsmith. This would remove the need for disk IO completely when getting the colors (no double loading)

Remember to pop Metalsmith context

const [img, alt, cssClass] = args;

For this to work as intended the last argument (which is always the context for some reason) needs to be popped off. if that is not done the arguments that are specified by the user , instead of been undefined as expected will be the metalsmith context.

It can be fixed by adding a line like

const ctx = args.pop()

This has to happen before the line referenced in line 51 (As seen above)

Get image color package to notice files that have changed content but not name.

There is a bug where when you change the image contents but not the name of that file image colors will not notice after the first run and the cache is built. This is because the cache currently uses a very simple way to workout if a file has changed. Basically it looks to see if there are more files than the last time , then it checks each filename to makes sure it is in the cache. So new files are scanned but not files that changes contents but not there name.

Improve Speed on image colors rebuild

I don't think much can be done about the initial image color build as it just has to look at every image and determine the colors. However we could make it so that a user can pass it some GLOBS to scan rather than every image file.

The bigger improvement would be to redesign the cache routines so that when an image is added or changes only that image is rescanned. Currently it just ignores the cache and starts the rescan again rebuilding the cache.

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.