https://github.com/takuya/ruby-mail-attachment-tiff
https://github.com/takuya/ruby-mail-attachment-tiff
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/takuya/ruby-mail-attachment-tiff
- Owner: takuya
- License: gpl-3.0
- Created: 2024-10-10T08:03:26.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-12-13T11:15:09.000Z (over 1 year ago)
- Last Synced: 2025-01-05T22:43:55.028Z (over 1 year ago)
- Language: Ruby
- Size: 1.46 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## オフィス用複合機のTIFFファイルを処理する。
自宅にある複合機はSMTP機能がある。ただし、スキャンとFAXはTIFFで処理される。
ところが、TIFFに写真が複数枚含まれるマルチパート(ページ)のTIFFファイルで、一部のメールソフトのプレビューでは見れない。
特に問題なのが、複数枚が想定されてないため、最初の1枚しか見えない点である。
そこで、メール内容を変更して、マルチページTIFFを複数枚PNGにかえて送信する。
GmailでTIFF表示すると、複数枚のTIFFを見落としがちだったので、このファイルを作った。
SMTPをプロキシしてTiffファイルをpngに変換して送信する。
TIFF複数枚が表示できないことが発端。
いまのGmailは複数枚でも問題なく表示できるので、不要になった。
### install as gem
```shell
[ -e Gemfile ] || bundle init
REPO_URL=https://github.com/takuya/ruby-mail-attachment-tiff.git
echo "gem 'takuya-ruby-mail-attachment-tiff', git: '$REPO_URL'" >> Gemfile
bundle install
```
### testing
```shell
git clone https://github.com/takuya/ruby-mail-attachment-tiff.git
cd ruby-mail-attachment-tiff
bundle install
bundle exec rspec spec
```
## ハマりどころ
image magick の convert で mutipage な tiff を 扱う場合 `+repage`をつける。
つけないと`negative image positions unsupported` となり変換できているのにエラーになり、変換できているのにmini-magickが例外で落ちる。