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

Kadai1 saza #90

Open
wants to merge 27 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
129 changes: 129 additions & 0 deletions kadai1/saza/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
gibo 2.2.4 by Simon Whitaker <[email protected]>
https://github.com/simonwhitaker/gibo
### https://raw.github.com/github/gitignore/218a941be92679ce67d0484547e3e142b2f5f6f0/Global/macOS.gitignore

# General
.DS_Store
.AppleDouble
.LSOverride
bin/
testdata/

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk


### https://raw.github.com/github/gitignore/218a941be92679ce67d0484547e3e142b2f5f6f0/Go.gitignore

# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# Dependency directories (remove the comment below to include it)
# vendor/


### https://raw.github.com/github/gitignore/218a941be92679ce67d0484547e3e142b2f5f6f0/Global/JetBrains.gitignore

# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser


8 changes: 8 additions & 0 deletions kadai1/saza/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions kadai1/saza/.idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions kadai1/saza/.idea/saza.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions kadai1/saza/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

77 changes: 77 additions & 0 deletions kadai1/saza/.idea/watcherTasks.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions kadai1/saza/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.PHONY: build
build:
@go build -o bin/imgconv .

.PHONY: run
run: ready build
@./bin/imgconv testdata

.PHONY: ready
ready:
@./init.sh
30 changes: 30 additions & 0 deletions kadai1/saza/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# 課題 1: imgconv

指定されたディレクトリ以下の画像ファイルを異なる形式に変換するコンソールアプリケーションです。

### Usage
```
imgconv [-s <src image type>] [-d <dest image type>] <target directory path>
```

`-s` で指定した形式の画像ファイルを、`-d` で指定した形式に変換します。

例えば、jpeg ファイルを png ファイルに変換すると、
指定されたディレクトリ以下の jpeg ファイル、`hoge.jpeg` に対し、
同じディレクトリにそれを png ファイルに変換した `hoge.png` が生成されます。

オプションの画像形式で指定できるものは以下の通りです。

- `jpg`: jpeg ファイル
- `png`: png ファイル
- `gif`: gif ファイル

オプションを指定しない場合、jpeg ファイルを png ファイルに変換します。

### make コマンド

#### ビルド
`make build` でビルドでき、 `bin/imgconv` が出力されます。

#### 実行
また、`make run` で `testdata/` にサンプルデータを生成し、それをターゲットとして実行することができます。
3 changes: 3 additions & 0 deletions kadai1/saza/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/saza-ku/gopherdojo-studyroom/kadai1/saza

go 1.17
Loading