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

Errors after upgrading to Crystal 0.35.0 #13

Closed
ptcodes opened this issue Jun 18, 2020 · 1 comment · Fixed by stumpycr/stumpy_png#31
Closed

Errors after upgrading to Crystal 0.35.0 #13

ptcodes opened this issue Jun 18, 2020 · 1 comment · Fixed by stumpycr/stumpy_png#31

Comments

@ptcodes
Copy link

ptcodes commented Jun 18, 2020

The library seems to be incompatible with the latest version of Crystal.

How to replicate:

canvas = StumpyPNG.read("image.png")
StumpyPNG.write(canvas, "output.png")

Output:

crystal run test.cr                                                                                                                                             ⏎
Warning: Zlib is deprecated, use Compress::Zlib
Showing last frame. Use --error-trace for full trace.

In /usr/local/Cellar/crystal/0.35.0/src/io/encoding.cr:42:23

 42 | bytes_written &+= io.write(outbuf.to_slice[0, outbuf.size - outbytesleft])
                    ^-
Error: no overload matches 'Int64#&+' with type (Int64 | Nil)

Overloads are:
 - Int64#&+(other : Int8)
 - Int64#&+(other : Int16)
 - Int64#&+(other : Int32)
 - Int64#&+(other : Int64)
 - Int64#&+(other : Int128)
 - Int64#&+(other : UInt8)
 - Int64#&+(other : UInt16)
 - Int64#&+(other : UInt32)
 - Int64#&+(other : UInt64)
 - Int64#&+(other : UInt128)
Couldn't find overloads for these types:
 - Int64#&+(other : Nil)

Potentially related to the Zlib library:

Warning: Zlib is deprecated, use Compress::Zlib

As per:
https://crystal-lang.org/2020/06/09/crystal-0.35.0-released.html

Some other clean-ups: Flate, Gzip, Zip, and Zlib were moved inside Compress module in #8886. Flate was renamed to Compress::Deflate, actually. You might need to require "compress/gzip" and change some constants here or there. The require "gzip" is still available but will show a deprecation warning.

@l3kn
Copy link
Collaborator

l3kn commented Jun 18, 2020

This is a known issue (stumpycr/stumpy_png#28) with stumpy_png, stumpy_core itself should not be affected by it.

The relevant changes in crystal have been reverted since the release of 0.35.0
and stumpy_png will be updated once 0.35.1 comes out.

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

Successfully merging a pull request may close this issue.

2 participants