probablycorey/mini_magick — Issue #70: Can't generate ico file with another extension
Author: pupeno
Created: 2012-01-15 19:15:28+00:00
State: open

Hello,

mini_magick can succesfuly generate an ico file with another extension but then it rases an exception anyway. I can do this and it works:

```ruby
f = MiniMagick::Image.open("boo.jpg")
f.resize "48x48"
f.format "ico"
f.write "boo.ico"
```

No problem and the file is created succesfuly. But if I do this, which is what carrierwave does, it generates an exception:

```ruby
f = MiniMagick::Image.open("boo.jpg")
f.resize "48x48"
f.format "ico"
f.write "boo_ico.jpg"
```

The exception is: MiniMagick::Error: Command ("identify -ping "boo_ico.jpg"") failed: {:status_code=>1, :output=>"identify: Not a JPEG file: starts with 0x00 0x00 boo_ico.jpg @ error/jpeg.c/JPEGErrorHandler/297.\n"}

Indeed the command fails like that. Are you not running that command when the extension is .ico? Maybe it shouldn't be run when the format is "ico" either. What do you think?

Note that saving a jpg as .png or a png as .jpg works fine. The problem is only with ico.

Are there any workarounds for this?