npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

dfocus-cordova-base64-to-gallery

v4.1.3

Published

Cordova plugin to save base64 data as a png image into the device

Downloads

4

Readme

Fork:

修改保存的类型为 jpeg 格式

:warning: DISCONTINUED - Cordova base64ToGallery Plugin

This plugin (based on devgeeks/Canvas2ImagePlugin) allows you to save base64 data as a png image into the device (iOS Photo Library, Android Gallery or WindowsPhone 8 Photo Album).

The plugin is a kind of fork of the solderzzc/Base64ImageSaverPlugin but with a cleaner history (a.k.a: no tags from Canvas2ImagePlugin repo) and a newer iOS implementation.

Alerts

Plugin id - issue #1

In order to be more consistent with the cordova naming convention, since version 2.0 the repository name and the cordova plugin id have changed to cordova-base64-to-gallery.

Please uninstall the old version and reinstall the new one.

cordova-ios > 3.8.0 - issue #3

According to the documentation, NSData+Base64.h class was removed starting from version 4.0.0 of the cordova-ios platform (and it was already deprecated from version 3.8.0).

So, cordova-base64-to-gallery plugin from version 3.0.0 has changed the iOS implementation in order to support the changes in cordova-ios platform.

If you need to support cordova-ios < 3.8.0 please refer to [email protected]. There is also an "old" branch that might have some updates in the future (Android/WP8 fixes or something like that).

Usage

Call the cordova.base64ToGallery() method with image's base64 string, success and error callbacks (options is optional):

Methods

cordova.base64ToGallery(data, [options, success, fail])

| Param | Type | Default | Description | | ----------- | ---------- | ----------------- | ----------------------------------------- | | data | string | | base64 string | | options | object | *see below | options | | success | function | console.log | success callback (file path as parameter) | | fail | function | console.error | fail callback (error as parameter) |

Available options *

prefix

Saved file name prefix.

Default: "img_"

mediaScanner

On Android runs Media Scanner after file creation.

On iOS if true the file will be added to camera roll, otherwise will be saved to a library folder.

Default: true

Example

function onDeviceReady() {
  cordova.base64ToGallery(
    base64Data,

    {
      prefix: "img_",
      mediaScanner: true,
    },

    function (path) {
      console.log(path);
    },

    function (err) {
      console.error(err);
    }
  );
}

Authors and contributors