Closed lwillmeth closed 10 years ago
i was thinking that the save method would just use the print method we already have. We could just have a different filechooser but one for saving then the user chooses where to save then the print function takes in the file directory to save and the filename they chose then outputs to a text file.
hm, I have the save feature working but with a bug. It works fine on .jpg and .png, but .gif files get corrupted. I think it's because .gif files can be transparent and .jpg cannot? Going to try to iron out the bug before committing changes.
I decided to just save as .gif so transparency can be maintained. We can come back and change this later if we need to conserve space, as .gif's seem to be about 3x bigger than .jpg's. But for now, functional > efficient.
If someone wanted to reopen this and convert transparency to white when opening a file, it would probably be an improvement as there's another open issue around the same problem.
Reopened because we should make sure the savedFiles/ folder is created before trying to save the file there. Perhaps as part of setupSaveButton() it should check if the folder exists and if not, create it?
Needs testing on mac/windows, but it should work.
The image and ascii are saved as separate files in a new Pictures/ directory which is created on demand.
I'm on the fence here, do we want to be able to save images? Should this be rolled into the print feature?
I think any image which is printed, should have the ascii text and image saved to a sub directory somewhere so we can make reprints.
So we probably need a save feature, and we probably need to call it from the print feature.