Skip to content
This repository was archived by the owner on Jul 24, 2026. It is now read-only.
This repository was archived by the owner on Jul 24, 2026. It is now read-only.

Plugin fails on Cordova iOS 4.0 #61

Open

Description

@racekarl

Cordova iOS 4 removed several deprecated methods which are used by this plugin, so the plugin crashes when used in an app built with Cordova iOS 4.

For example, this line:

NSData* imageData = [NSData dataFromBase64String:[command.arguments objectAtIndex:0]];

Causes a crash because dataFromBase64String no longer exists in Cordova iOS 4.0:

https://github.com/apache/cordova-ios/blob/master/guides/API%20changes%20in%204.0.md

Activity

  1. racekarl commented on Jan 26, 2016

    @racekarl
    Author

    Yes, @devgeeks mentioned on another issue that this plugin was essentially abandoned, but I figured I would report the issue in case someone else wants to take it over.

    I'm slogging through a fix for this issue because I need it ASAP to solve a production issue I have, but I am not an Objective C programmer, so I am fumbling in the dark...

    I will post what I find here, and do let me know if you fork this, replace it, or take it over - I can at least help with testing.

  2. devgeeks commented on Jan 26, 2016

    @devgeeks
    Owner

    @createstandard - I would love someone to take it over :(

    I created the plugin originally as a throwaway as an answer to a stack overflow question and it has gotten a bit out of control ;)

  3. racekarl commented on Jan 26, 2016

    @racekarl
    Author

    OK, I got this working on Cordova iOS 4. I have no idea if what I have done is terrible or not, but it does what I need it to do. This functionality is ancillary to my app, so it's not as critical to me as it may be to you @Createstandard.

    I have attached my copy of Canvas2ImagePlugin.m with my changes (as a text file since that's what github supports)

    Canvas2ImagePlugin.txt

  4. added a commit that references this issue on Mar 14, 2016
  5. SebastianSchirmer commented on Apr 21, 2016

    @SebastianSchirmer

    To anyone who might be interested, we just release another plugin to npm, called cordova-plugin-save-image. This plugin is not using bas64 encoded images but file paths to images available on the device already and copies them to the camera roll / Gallery. We have taken some code element from the Canvas2Image plugin, thx a lot for this. In addition we are considering to maybe take over this one (merge with save-image plugin) going forward.

  6. devgeeks commented on Apr 21, 2016

    @devgeeks
    Owner

    As I said before... I would looooove someone to take this over. It obviously fills a need for some people, but it's not something I am keen to maintain.

  7. SebastianSchirmer commented on Apr 22, 2016

    @SebastianSchirmer

    Ok, I'll discuss within the team

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions