Skip to content

Commit

Permalink
Fix saving of PNG images for failed tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonSapin committed Aug 3, 2012
1 parent 20f46ea commit c2a88cf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions weasyprint/images.py
Expand Up @@ -34,7 +34,7 @@
def save_pixels_to_png(pixels, width, height, filename):
"""Save raw pixels to a PNG file through pixbuf and PyGTK."""
gdk.pixbuf_new_from_data(
pixels, gdk.COLORSPACE_RGB, False, 8, width, height, width * 3
pixels, gdk.COLORSPACE_RGB, True, 8, width, height, width * 4
).save(filename, 'png')

def gdkpixbuf_loader(file_obj, string):
Expand Down Expand Up @@ -66,8 +66,8 @@ def save_pixels_to_png(pixels, width, height, filename):
"""Save raw pixels to a PNG file through pixbuf and introspection."""
from gi.repository import GdkPixbuf
GdkPixbuf.Pixbuf.new_from_data(
pixels, GdkPixbuf.Colorspace.RGB, False, 8,
width, height, width * 3, None, None
pixels, GdkPixbuf.Colorspace.RGB, True, 8,
width, height, width * 4, None, None
).savev(filename, 'png', [], [])

try:
Expand Down

0 comments on commit c2a88cf

Please sign in to comment.