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

pygame.image.save can't save in png format #13

Closed
illume opened this issue Aug 22, 2011 · 1 comment
Closed

pygame.image.save can't save in png format #13

illume opened this issue Aug 22, 2011 · 1 comment
Labels
bug image pygame.image

Comments

@illume
Copy link
Member

illume commented Aug 22, 2011

Originally reported by: René Dudfield (Bitbucket: illume, GitHub: illume)


== Nick Irvine, 2008-04-11 04:52:11 -0700

Created attachment 8
Bugfix patch

pygame.image.save doesn't save to the correct format.  This code should demonstrate:

import pygame

#original test file is a 320x240 88.7kB png file 
im = pygame.image.load('/tmp/img0.png')

#yields img1.png, 13.0kB jpeg file
pygame.image.save(im, '/tmp/img1.png')

#yields img2.PNG, 191.5 kB TGA file
pygame.image.save(im, '/tmp/img2.PNG')

#yields img3.tga, 191.5 kB TGA file
pygame.image.save(im, '/tmp/img3.tga')

#yields img4/jpeg, 13.0 kB jpeg file
pygame.image.save(im, '/tmp/img4.jpeg')

#end of script

I believe the problem lies in src/imageext.c, around line 450.  I've attached a patch which I believe fixes the problem.

Attachments:
[[http://www.pygame.org/old_bug_attachments/8/imageext.c| imageext.c]]

== Nick Irvine, 2008-04-11 04:53:28 -0700

By the way, this is one of my first patches ever, so comments on the way I've submitted it are welcome.

== Thorbrian, 2008-04-12 13:58:26 -0700

committed 1205

Nick, please confirm in that revision.

... as far as feedback on the patch goes - what you submitted is a patched file, which is not the same thing as a patch. Subversion can produce patches for you with the diff command.

Your test script was great, btw - turns out there was also a problem with saving .JPEG files (would save as TGA's)

== Nick Irvine, 2008-04-13 02:13:53 -0700

I actually did create a diff, but attached the wrong file.  D'oh!


@illume
Copy link
Member Author

illume commented Jan 11, 2017

Original comment by Thomas Kluyver (Bitbucket: takluyver, GitHub: takluyver):


Removing version: unspecified (automated comment)

@illume illume added trivial bug image pygame.image labels Mar 26, 2017
@illume illume closed this as completed Mar 26, 2017
robertpfeiffer pushed a commit to robertpfeiffer/pygame that referenced this issue Feb 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug image pygame.image
Projects
None yet
Development

No branches or pull requests

1 participant