should `load(::Stream, ...)` methods skip magic bytes?
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 35/100
- issue の種類
- ドキュメント
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- julia
調査の方向性
README のストリーム読み込み例を読み、test/constructed_images.jl の 195-201 行にあるリンク先の ImageMagick.jl のテストを確認してください。load(::Stream) が呼び出されるときのストリームの想定位置を確認し、maintainers が確認した場合は、契約と使用方法を明確に記載するよう README を更新してください。
索引モデルが issue の本文から書いたものです。
説明
In the README, the example for loading from a stream is:
function load(f::File{format"PNG"})
open(f) do s
skipmagic(s) # skip over the magic bytes
# You can just call the method below...
ret = load(s)
# ...or implement everything here instead
end
end
# You can support streams and add keywords:
function load(s::Stream{format"PNG"}; keywords...)
# s is already positioned after the magic bytes
# Do the stuff to read a PNG file
chunklength = read(s, UInt32)
...
end
This works if the user calls load("somefile.png"), which will end up calling the load(::File, ...) method, which handles skipping the magic bytes before calling load(::Stream). What I'm not super clear on is how this is intended to be used directly. e.g. I couldn't just do:
open("somefile.png") do io
load(io)
end
In ImageMagick.jl it looks like load is called on the IO stream directly without skipping the magic(k) bytes.
So if it seems like the way ImageMagick does it (leaving the stream at the very beginning of the file when calling load(::Stream)) I can put in a documentation PR that clarifies that.
- 主要言語
- Julia
- スター
- 228
- フォーク
- 83
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
JuliaIO/FileIO.jl のほかの issue
-
Drop the hard `Pkg` dependency対応中かも @thchr が 26 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 52/100
-
Add SVGZ formatオープン
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
JuliaIO/FileIO.jl の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
-
question
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
brown-ccv/Chamber.jl#272 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
JuliaAstro/SolarPosition.jl#143 ·
-
distributions
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
JuliaBayes/Wren.jl#404 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
JuliaAI/MLJTransforms.jl#113 ·
メンテナーはふだん 1 日以内に返信