# Image\_tag size question

**URL:** <https://www.ruby-forum.com/t/image-tag-size-question/83421>\
**Category:** Rails\
**Created:** [January 25, 2007, 10:05pm UTC](https://www.ruby-forum.com/t/image-tag-size-question/83421 "2007-01-25T22:05:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![harm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b4bc9f/32.png) [@harm](https://www.ruby-forum.com/u/harm)\
**Post date:** [January 25, 2007, 10:05pm UTC](https://www.ruby-forum.com/t/image-tag-size-question/83421/1 "2007-01-25T22:05:33Z")

</div>

Hi all,  
This used to work in Rails 1.1:  
\<%= image\_tag(‘blue.jpg’, :size =\> “#{count / total \* max\_length}x9”) %\>  
However now in 1.2 it seems broken. This expression yield an unresize  
1x1 blue pixel.  
What am I doing wrong? All the variables used exist…

Harm

---

<div class="post-metadata">

**Author:** ![harm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b4bc9f/32.png) [@harm](https://www.ruby-forum.com/u/harm)\
**Post date:** [January 25, 2007, 10:25pm UTC](https://www.ruby-forum.com/t/image-tag-size-question/83421/2 "2007-01-25T22:25:50Z")

</div>

Harm Aa wrote:

> Hi all,  
> This used to work in Rails 1.1:  
> \<%= image\_tag(‘blue.jpg’, :size =\> “#{count / total \* max\_length}x9”) %\>  
> However now in 1.2 it seems broken. This expression yield an unresize  
> 1x1 blue pixel.  
> What am I doing wrong? All the variables used exist…
> 
> Harm

As tradition dictates, it suddenly hit me. Count and total where  
integers… And got rounded down to zero… Right, fixed it. Thanks you  
all for your attention, I’m going to be embarrassed now.

Harm
