Giter Club home page Giter Club logo

changedpi's People

Contributors

asturur avatar jasonoh avatar remi-ibi 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

changedpi's Issues

Add to npm repository

I'd like to be able to use this util library using the latest JS ecosystem. To do this, it would be good if this library was published to npm or yarn.

changeDpiDataUrl() sometimes returns invalid PNGs.

When I pass the attached PNG image in changeDpiDataUrl(), it returns an invalid PNG. It's easy to reproduce:

var res = changeDpiDataUrl(attached_png, 300);

'res' will be a badly formed PNG image.

I don't fully understand the code, but it looks like detectPhysChunkFromDataUrl() cannot find what it's looking for, so it returns -1. The calling code checks if the return value is truthy; -1 is, so the header length calculation is wrong.

base64_png.txt

Improvements in documentation

I would like to contribute with improvements in documentation such as README, CHANGELOG and also translate to Brazilian Portuguese.

Uncaught ReferenceError: exports is not defined

Getting Uncaught ReferenceError: exports is not defined upon loading my webapp

Details

Angular 12 webapp
In package.json: "changedpi": "^1.0.4",
"node_modules/changedpi/dist/index.js" added to angular.json under architect.build.scripts
declare module 'changedpi' added to src/typings.d.ts
Imported into component using import * as changedpi from 'changedpi';

Upon loading webapp:
image

Clicking on error shows source:
image

Can anyone advise if I've integrated incorrectly, or if there's an underlying issue in the library?

Failed to load resource: Data URL decoding failed

I want to improve the quality of an image, but I am not able to display the image generated with the changeDpiDataUrl function. The error I get is "Failed to load resource: Data URL decoding failed".
Without using the base64header, I have no problems. But as soon as the base64header is included, my browser is not able to resolve the image.
My function looks like this
image

Has anyone had the same problem and knows a solution?

Using with image/png

Is it correct that you can only use jpeg, I am trying to use this project with data urls encoded in image/png?!

Support for Node.js

Expected behavior

I was expecting this module to work on Node.js, am I wrong?

Actual behavior

It throws an error because of: FileReader is not defined

Steps to reproduce the behavior

Additional specs (e.g. browser, version, etc.)

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.