-
Notifications
You must be signed in to change notification settings - Fork 6
【課題1】画像変換コマンド作成 #4
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
base: master
Are you sure you want to change the base?
Conversation
} | ||
|
||
// fromPath の画像形式を取得し、c.FromFormat と比較する | ||
if targetFormat := GetImageFormat(strings.Replace(filepath.Ext(fromPath), ".", "", 1)); targetFormat != c.FromFormat { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
拡張子が大文字の場合は?
// fromPath の拡張子以前と結合する | ||
toPath := fromPath[0:len(fromPath)-len(filepath.Ext(fromPath))] + ".png" | ||
|
||
toImg, err := os.Create(toPath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
toImg
がClose
されていない
// fromPath の拡張子以前と結合する | ||
toPath := fromPath[0:len(fromPath)-len(filepath.Ext(fromPath))] + ".jpg" | ||
|
||
toImg, err := os.Create(toPath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
toImg
がClose
されていない
// fromPath の拡張子以前と結合する | ||
toPath := fromPath[0:len(fromPath)-len(filepath.Ext(fromPath))] + ".gif" | ||
|
||
toImg, err := os.Create(toPath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
toImg
がClose
されていない
仕様
使い方
README.md を参照してください。
難しかったところ
pkg
とcmd
の切り分けがうまく行っておらず、test しやすい形に持っていけなかった。GoDoc