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

Multiple image resize recursivelly ends up with fatal error #22

Open
umpirsky opened this issue Mar 29, 2015 · 5 comments
Open

Multiple image resize recursivelly ends up with fatal error #22

umpirsky opened this issue Mar 29, 2015 · 5 comments

Comments

@umpirsky
Copy link

I want to resize all images inside this folder recursively (and keep folder structure).

Here is my config:

image_resize: {
      resize: {
        options: {
          width: 400,
        },
        expand: true,
        src: '<%= yeoman.app %>/images/menu/**/*',
        dest: '<%= yeoman.dist %>/thumbnails/'
      }
    }

When I run it:

$ grunt image_resize
Running "image_resize:resize" (image_resize) task
Fatal error: Cannot read property 'width' of undefined


Execution Time (2015-03-29 00:24:10 UTC)
loading tasks         2ms  ▇▇▇ 3%
image_resize:resize  77ms  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 97%
Total 79ms

Code is available on umpirsky/stajesti.rs@24f3b76.

I am aware of #14 and #11, but looks like it is not my case.

I noticed that it resizes successfully only for first folder, and then fails with this error.

@caiobleggi
Copy link

+1 (win10)

@caiobleggi
Copy link

Found any solution?

@umpirsky
Copy link
Author

Iirc I ended up using grunt-responsive-images.

@nicothin
Copy link

+1 (win 10 64)

@honsa
Copy link

honsa commented Dec 10, 2017

Had same issue, image resize shows this error on grunt job

Fatal error: Cannot read property 'width' of undefined

Problem can be tracked down to line 72 in image_resize.js

gm.(filepath).size(function(err))

which err output shows:

Error: Could not execute GraphicsMagick/ImageMagick: identify "-ping" "-format" "%wx%h" 
"public/img/xyz.jpg" this most likely means the gm/convert binaries can't be found

Solution on win10 is, reinstall ImageMagick with the legacy utilities

image

https://github.com/bamlab/generator-rn-toolbox/blob/master/generators/assets/README.md#troubleshooting

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

4 participants