@@ -4,7 +4,7 @@ module Pluto::Format::PNG
4
4
macro included
5
5
def self.from_png (image_data : Bytes ) : self
6
6
ctx = Format ::Binding ::LibSPNG .ctx_new(Format ::Binding ::LibSPNG ::CtxFlags ::None )
7
- raise :: Pluto :: Exception .new(" Failed to create a context" ) unless ctx
7
+ raise Exception .new(" Failed to create a context" ) unless ctx
8
8
9
9
Format ::Binding ::LibSPNG .set_png_buffer(ctx, image_data, image_data.size)
10
10
@@ -47,7 +47,7 @@ module Pluto::Format::PNG
47
47
end
48
48
49
49
protected def self.check_png (code )
50
- raise :: Pluto :: Exception .new(code) if code != 0
50
+ raise Exception .new(code) if code != 0
51
51
end
52
52
end
53
53
@@ -61,7 +61,7 @@ module Pluto::Format::PNG
61
61
end
62
62
63
63
ctx = Format ::Binding ::LibSPNG .ctx_new(Format ::Binding ::LibSPNG ::CtxFlags ::Encoder )
64
- raise :: Pluto :: Exception .new(" Failed to create a context" ) unless ctx
64
+ raise Exception .new(" Failed to create a context" ) unless ctx
65
65
66
66
Format ::Binding ::LibSPNG .set_option(ctx, Format ::Binding ::LibSPNG ::Option ::EncodeToBuffer , true )
67
67
Format ::Binding ::LibSPNG .set_png_buffer(ctx, image_data.buffer, image_data.size)
@@ -83,7 +83,7 @@ module Pluto::Format::PNG
83
83
check_png error
84
84
85
85
buffer = Format ::Binding ::LibSPNG .get_png_buffer(ctx, out size, pointerof (error))
86
- raise :: Pluto :: Exception .new(" Failed to get a buffer" ) unless ctx
86
+ raise Exception .new(" Failed to get a buffer" ) unless ctx
87
87
88
88
bytes = Bytes .new(buffer, size)
89
89
io.write(bytes)
0 commit comments