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

width height options is not working #43

Open
Julyyq opened this issue Jun 8, 2015 · 0 comments
Open

width height options is not working #43

Julyyq opened this issue Jun 8, 2015 · 0 comments

Comments

@Julyyq
Copy link

Julyyq commented Jun 8, 2015

I have 2 source images with 500x500 size, and I want to fix the width and height of each sprite images to 100, but get the following error:

image test1 does not fit within a fixed width of 100 (RuntimeError)

Seems this options is not working as expect.

I check the source code of this very useful library, found the error comes from here:

images.each do |i|
  i[:name], i[:ext] = map_image_filename(i[:filename], input_path)
  raise RuntimeError, "image #{i[:name]} does not fit within a fixed width of #{width}" if width && (width < i[:width])
  raise RuntimeError, "image #{i[:name]} does not fit within a fixed height of #{height}" if height && (height < i[:height])
end

Only if the options's width or height is less than the width or height of the image, this error occurs, the correct logic maybe is more than .

So, I try to change the < to >, the generated sprites size is then correct, but the source image size is clipped but not stretched. Is this a bug?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant