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

program crash if saving original image - unedited #6

Closed
bikedel opened this issue Jan 16, 2021 · 0 comments
Closed

program crash if saving original image - unedited #6

bikedel opened this issue Jan 16, 2021 · 0 comments

Comments

@bikedel
Copy link

bikedel commented Jan 16, 2021

Hello

if the image has not been edited the program crashes when trying to save

*** my fix was to check a.img.EditedImage is set
*** I also added case ".jpg" for encoding

fileio.go

// if file has not been edited
if (a.img.EditedImage == nil ){
   a.apply()
}
switch writer.URI().Extension() {
case ".jpg":
	jpeg.Encode(writer, a.img.EditedImage, nil)		
case ".jpeg":
	jpeg.Encode(writer, a.img.EditedImage, nil)
case ".png":
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant