Skip to content

Commit

Permalink
article: fix indent
Browse files Browse the repository at this point in the history
  • Loading branch information
macrat committed Mar 23, 2024
1 parent a2a0939 commit f6527d8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions pages/blog/2024/01/golang-read-write-exif.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,12 @@ import (
)

func main() {
// ...省略...
// ...省略...

list := tag.Value.([]exifcommon.Rational)
float := float64(list[0].Numerator) / float64(list[0].Denominator)
list := tag.Value.([]exifcommon.Rational)
float := float64(list[0].Numerator) / float64(list[0].Denominator)

fmt.Printf("変換前: %v\n変換後: %f\n", tag.Value, float)
fmt.Printf("変換前: %v\n変換後: %f\n", tag.Value, float)
}
```

Expand Down
18 changes: 9 additions & 9 deletions pages/blog/2024/02/golang-write-text-on-image.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,22 +196,22 @@ import (
// 描画する文字列。
text := "Hello, World! こんにちは、世界!\nThis is a test."

// 1行ずつに分割する。
lines := strings.Split(text, "\n")
// 1行ずつに分割する。
lines := strings.Split(text, "\n")

// 1行ずつ描画する。
for lineOffset, line := range lines {
d.Dot.Y = fixed.I(50 + lineOffset * lineHeight)
d.Dot.Y = fixed.I(50 + lineOffset * lineHeight)
d.DrawString(line)
}

// ここから下は一緒

// 画像をoutput.jpgとして保存する。
out, err := os.Create("output.jpg")
if err != nil {
log.Fatal(err)
}
if err != nil {
log.Fatal(err)
}
defer out.Close()
if err := jpeg.Encode(out, img, nil); err != nil {
log.Fatal(err)
Expand Down Expand Up @@ -391,9 +391,9 @@ func main() {

// 画像をoutput.jpgとして保存する。
out, err := os.Create("output.jpg")
if err != nil {
log.Fatal(err)
}
if err != nil {
log.Fatal(err)
}
defer out.Close()
if err := jpeg.Encode(out, img, nil); err != nil {
log.Fatal(err)
Expand Down

0 comments on commit f6527d8

Please sign in to comment.