mirror of
https://github.com/gopl-zh/gopl-zh.github.com.git
synced 2025-10-24 15:32:52 +00:00
ch10: fix code path
This commit is contained in:
@@ -10,8 +10,8 @@ import _ "image/png" // register PNG decoder
|
||||
|
||||
標準庫的image圖像包包含了一個`Decode`函數,用於從`io.Reader`接口讀取數據併解碼圖像,它調用底層註冊的圖像解碼器來完成任務,然後返迴image.Image類型的圖像。使用`image.Decode`很容易編寫一個圖像格式的轉換工具,讀取一種格式的圖像,然後編碼爲另一種圖像格式:
|
||||
|
||||
<u><i>gopl.io/ch10/jpeg</i></u>
|
||||
```Go
|
||||
gopl.io/ch10/jpeg
|
||||
// The jpeg command reads a PNG image from the standard input
|
||||
// and writes it as a JPEG image to the standard output.
|
||||
package main
|
||||
|
||||
Reference in New Issue
Block a user