# Mini\_magick stdout

**URL:** <https://www.ruby-forum.com/t/mini-magick-stdout/133782>\
**Category:** Ruby\
**Created:** [April 3, 2008, 3:32pm UTC](https://www.ruby-forum.com/t/mini-magick-stdout/133782 "2008-04-03T15:32:41Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![kyleh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/a9a28c/32.png) [@kyleh](https://www.ruby-forum.com/u/kyleh)\
**Post date:** [April 3, 2008, 3:32pm UTC](https://www.ruby-forum.com/t/mini-magick-stdout/133782/1 "2008-04-03T15:32:41Z")

</div>

Hello,

I’m using mini\_magick to interface imagemagick. My script runs on win32  
through rubyw.exe. Unfortunately, everytime mini\_magick performs an  
operation a command prompt pops up. I’ve already tried specifying  
$stdout = $stderr = File.new(“stdout.log”, “w”)  
But it still pops up.

How can I suppress these command prompts?

–  
Thanks, Kyle ‘Phenax’ Hunter  
[http://keletech.org/blog/](http://keletech.org/blog/)

---

<div class="post-metadata">

**Author:** ![kyleh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/a9a28c/32.png) [@kyleh](https://www.ruby-forum.com/u/kyleh)\
**Post date:** [April 3, 2008, 5:25pm UTC](https://www.ruby-forum.com/t/mini-magick-stdout/133782/2 "2008-04-03T17:25:38Z")

</div>

> How can I suppress these command prompts?  
> I can help you out since I wrote it. We should probably move the  
> conversation over to [http://rubyforge.org/projects/mini-magick](http://rubyforge.org/projects/mini-magick)  
> though.  
> What command are you running through mini\_magick?  
> Since mini\_magick just sends out shell commands to imagemagick I would  
> first try and directly run the commands through imagemagick like  
> `mogrify -resize 256x256 *.jpg` to see if it is a imagemagick problem.

Corey

---

<div class="post-metadata">

**Author:** ![kyleh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/a9a28c/32.png) [@kyleh](https://www.ruby-forum.com/u/kyleh)\
**Post date:** [April 3, 2008, 6:29pm UTC](https://www.ruby-forum.com/t/mini-magick-stdout/133782/3 "2008-04-03T18:29:24Z")

</div>

p. Corey wrote:

> first try and directly run the commands through imagemagick like  
> `mogrify -resize 256x256 *.jpg` to see if it is a imagemagick problem.

Yes, using `mogrify -resize 256x256 *.jpg` produces a command prompt,  
just as using mini\_magick did.

---

<div class="post-metadata">

**Author:** ![kyleh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/a9a28c/32.png) [@kyleh](https://www.ruby-forum.com/u/kyleh)\
**Post date:** [April 3, 2008, 7:25pm UTC](https://www.ruby-forum.com/t/mini-magick-stdout/133782/4 "2008-04-03T19:25:00Z")

</div>

Let me add a clarification.

I run it through rubyw.exe with no command prompt at all. (I use Ruby  
one-click installer, and open it). The command prompts that pop up  
per-operation almost instantly disappear. If I run rubyw.exe through a  
command prompt and leave it open for the operations of my script, the  
per-operation command prompts that open and close quickly do not come  
up.

How can I redirect it to \>NUL without opening it in a command prompt?

---

<div class="post-metadata">

**Author:** ![kyleh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/a9a28c/32.png) [@kyleh](https://www.ruby-forum.com/u/kyleh)\
**Post date:** [April 3, 2008, 6:44pm UTC](https://www.ruby-forum.com/t/mini-magick-stdout/133782/5 "2008-04-03T18:44:10Z")

</div>

On 3 Apr 2008, at 17:29, Kyle H. wrote:

> p. Corey wrote:
> 
> > first try and directly run the commands through imagemagick like  
> > `mogrify -resize 256x256 *.jpg` to see if it is a imagemagick  
> > problem.
> 
> Yes, using `mogrify -resize 256x256 *.jpg` produces a command prompt,  
> just as using mini\_magick did.

In which case try adding redirection e.g. \> NUL, or to file, as  
appropriate. You might need to do stderr too.

---

<div class="post-metadata">

**Author:** ![kyleh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/a9a28c/32.png) [@kyleh](https://www.ruby-forum.com/u/kyleh)\
**Post date:** [April 4, 2008, 10:56am UTC](https://www.ruby-forum.com/t/mini-magick-stdout/133782/6 "2008-04-04T10:56:32Z")

</div>

You could checkout various things in cmd.exe, and start.exe (help cmd,  
help start, in the command prompt)

I’m certain there’s a way, but I can’t remember the specifics off of  
the top of my head, sorry.

Also, don’t forget, it’s not just stdout, but stderr 🙂
