Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Save back to original file format #733

Open
ghost opened this issue Aug 17, 2017 · 16 comments
Open

[Feature Request] Save back to original file format #733

ghost opened this issue Aug 17, 2017 · 16 comments
Labels

Comments

@ghost
Copy link

ghost commented Aug 17, 2017

Allow the quick saving of the currently selected frame to a PNG/JPG file without having to use export mechanism. If the frame was imported from a PNG/JPG save back to the original file. This would allow Piskel to be used for Minecraft image work such as blocks, items, wrap textures for armor, mobs, entities, animated textures, etc.

How it would be used with an existing file:

  1. User is opens a PNG/JPG in Piskel
  2. User makes changes to the PNG/JPG file in Piskel
  3. User clicks the "quick save" button to save the changes to the file.

How it would be used with an frame created in Piskel

  1. User selects a frame with an image
  2. User clicks the "quick save" button to save the selected frame to disk
  3. User selects the saved file format (PNG/JPG)
  4. System file browser opens and the user selects the folder and then file name
  5. From that point on the "existing file" logic from above would come into play.
@DrEthan77
Copy link

this would be great. XD

@blurymind
Copy link
Contributor

blurymind commented May 7, 2018

I will need to do something similar for #805
:)

@blurymind
Copy link
Contributor

How about:
If frame was imported image - have piskel store metadata about its original path in the frame. When quicksaving - write the changes back to the original file.
If frame was created inside piskel, create a new file - trying to guess the path:

  • If there are other imported frames- use the path of the one found first
  • if not- save it to the desktop

@DrEthan77
Copy link

I like it.

@DrEthan77
Copy link

@blurymind So is there any progress on this feature?

@blurymind
Copy link
Contributor

This is something that you can kind of get when using it in Gdevelop already :) I have no plans to add it to standalone piskel. Still trying to get my previous prs merged

@DrEthan77
Copy link

:'(

@blurymind
Copy link
Contributor

blurymind commented Feb 12, 2020

maybe somebody else will address this and do a PR :) remember I am not the main dev of this app and can't even get a PR merged yet. I want the feature too. If you mention me on it expecting progress, you are mentioning the wrong person.

I wrote a wrapper for piskel on gdevelop which can do it. I mention it in case you re interested to try it

@blurymind
Copy link
Contributor

blurymind commented Feb 12, 2020

I must also note to any non-developers that this feature requires a kind of a file system access that piskel as a web app cannot have for obvious security reasons. (imagine if any website could overwrite files on your file system)
In order to implement it, one must add nwjs specific code. The way my wrapper does it in Gdevelop relies on the fact the user is running piskel in electron with nodejs there.
You can thumb me down all you want, but the feature wont appear on this branch without the official dev's support 🤣 and I wont put any effort into something that might get merged next year/never. I have other features that I want merged way more than this. That said, maybe somebody else might be interested? If I dont clearly state my intention to not work on it, other developers might pass it by thinking I might do it

@DrEthan77
Copy link

DrEthan77 commented Feb 12, 2020

So why don't you just not worry about getting things merged? Just make all the new things on your repo. (I am not asking about this because I think I will still get this feature I am just wondering. BTW the thumbs down was a joke ;) )

@blurymind
Copy link
Contributor

Because I want to have one codebase, not spread features across forks. My fork has already deviated a lot from this one

@blurymind
Copy link
Contributor

blurymind commented Feb 13, 2020

Here is my wrapper code in case somebody is interested to implement this
https://github.com/4ian/GDevelop/blob/master/newIDE/app/public/external/piskel/piskel-main.js
Its a bit hacky how interacts with piskel due to the way we wrap it. implementing this in piskel-standalone would be much easier

it uses node's fs and path, which are only available when running from electron/nwjs

If you want to import them in piskel's desktop version without crashing the web app, you might need something like
https://github.com/4ian/GDevelop/blob/master/newIDE/app/src/Utils/OptionalRequire.js
and also check if the imported fs/path are truthy before using them

@blurymind
Copy link
Contributor

actually piskel already uses fs
https://github.com/piskelapp/piskel/search?q=fs+%3D&unscoped_q=fs+%3D
this might be less work that I thought

@DrEthan77
Copy link

@blurymind i am guessing fs is only available in the desktop app? (i.e. when you have access to the fs [file system])

@blurymind
Copy link
Contributor

@blurymind i am guessing fs is only available in the desktop app? (i.e. when you have access to the fs [file system])

Yes that will always be the case :) unless web API starts allowing giving access to the user to enable file system file overwrite. Chrome currently has API preview that is just for developers, which may take years to be approved as a web standard

@DrEthan77
Copy link

nice, seeing as I only use the desktop app that is perfect for me :D.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants