Could not extract width/height from image: http://www.mysite.tld/sites/default/files/styles/galleria_thumb/public/2.... Traced measures: width:0px, height: 0px.

Works fine in Chrome and Safari.

CommentFileSizeAuthor
#24 galleria-1.2.6_try_catch_patch.js_.txt150.76 KBpivica
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

miro_dietiker’s picture

There are also other issues about that.
Note that the galleria (JS source) plugin itself has also some limitations and (i really hope) they work on this.

You can set some width / height manually in your css for the container and it will work. But since we don't know your params, we cannot set them in our theme.

gumdrop’s picture

What would be the best example to set them in your theme? Wading through this css is somewhat a nightmare at this time.
This seems to work setting them up with views jqfx galleria. Not a problem there. Thanks for your help.

kroimon’s picture

Have you tried setting an explicit width and height in your option set?

gumdrop’s picture

If you are referring to the Galleria configuration option settings yes. I am using the default option set which has the height and width specified for example 300 x 400.
As I said above the gallery renders fine under Chrome & Safari browsers. But not under IE or Firefox.

kroimon’s picture

Hm, although I suspect it's a bug in the library and not in the module, would it be possible for you to give us a link to your page where the problem occurs?
If you don't want to post it to the public, you can also send it to me by mail.

kroimon’s picture

Status: Active » Closed (works as designed)

Thanks for sending me the link.

I don't know what causes Galleria to fail, I just suspect some unfortunate CSS, but found an issue at GetSatisfaction with a workaround that you can try.

I close this issue here as it's not a bug with the Drupal module.

gumdrop’s picture

Category: bug » support
Status: Closed (works as designed) » Closed (fixed)

@kroiman ~ Thanks for the link at GetSatisfaction.

I applied:

Solution:
Replace code "Galleria.raise('Could not extract width/height from image: ' + img.src +
'. Traced measures: width:' + img.width + 'px, height: ' + img.height + 'px.'); " wit this try catch block :

try {
$('<img/>').attr('src',$(img).attr("src")).load(function() {complete.call( this )})
} catch(error_message) {
Galleria.raise('Could not extract width/height from image: ' + img.src +
'. Traced measures: width:' + img.width + 'px, height: ' + img.height + 'px.');
} 

to galleria-1.2.5.js and this solved my problem.

sdk’s picture

I tried changing the snippet in the .js but it didn't work for me. It workes fine on Safari but not in Firefox.

sdk’s picture

Problem seems to be theme (CSS) related. Works fine in e.g. Bartik. Could you maybe elaborate on your CSS solution?

gumdrop’s picture

The module also pulls in galleria-1.2.5.min.js. So unless you make changes in both the files it may not work.

sdk’s picture

I have applied the change to galleria-1.2.5.min.js as well but no change...

For the problem occurs in connection with the Corolla theme, I opened an issue there
http://drupal.org/node/1313054

I posted the issue also here and got the reply that it could be related to slow servers and / or the div order.

Could still find no solution though.

gumdrop’s picture

I am using Corolla as well but with Footheme.

sdk’s picture

Would you be so kind and upload the changed .js files somewhere? eventually I made a mistake in placing the snippet. I tried it twice though...

kroimon’s picture

@sdk: You don't have to change it in both .js files. You can just change it in the non-minified version and delete the minified version. The module will then use the non-minified version, which is way easier to modify.

@all: Can you somehow try setting the Galleria width&height using CSS? If that fixes your problems, I could add an option to the module to set the size via CSS, not the default way of just giving these values to the Galleria javascript.

gumdrop’s picture

@kroimon, I would of done that in the beginning but Adaptivethemes is a monster to get your head around...especially if you are adding the sub-themes. Also I think Views jQFX Galleria has that option and I experienced no issues with it.

Minotaur Wrangler’s picture

Status: Closed (fixed) » Needs review

I'm having this exact same problem RIGHT NOW and I'm using adaptive themes. It hasn't been a fun evening, that's for sure. All the CSS changes I'm seeing floating on the web? Not working. This .js change? Didn't work. When I pulled the plug on the party with minified .js ALL of them stopped working.

I need an answer to this now. How do I get galleria's module to actually work in IE7+ in Drupal? (works fine in Chrome)

kroimon’s picture

Status: Needs review » Active

@Craigotron: Not the best start to enter a discussion, hm? I understand you're angry, but we're all doing this in our spare time, and we're not the ones who develop the Galleria library, just the Drupal module to embed it into a Drupal site. So if you need an answer "now", then start debugging yourself, which is the same we would have to do otherwise.

To help you a little: I think, the problem somehow depends on the site's CSS. To verify this assumption, please check if it works when you switch to the default Drupal 7 theme (Bartik).
Then, try to temporarily delete/disable one half of your CSS statements of you real theme. If it still errors out, try to disable the other half and reenable the first half. I think you get it. Try to narrow it down to the CSS rule(s) that cause the problem and report it back! :-)

cat-topanga’s picture

I had a similar problem to this...

If you have this line in your css somewhere possibly in a reset or normalize.

img {max-width: 100%;}

Then qualify it or get rid of it...

Worked for me...

kroimon’s picture

@Craigotron:
Would be great if you could check what cat-topanga proposed and report back again!
Otherwise I'll close this issue again in a few days as being fixed...

kroimon’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

pivica’s picture

Had the same problem for IE7/8/9. Tried different solutions + updating to galleria 1.2.6 like suggested in http://getsatisfaction.com/galleria/topics/could_not_extract_width_heigh... - this didn't helped also.

On the end the only thing that worked was wrapping that Galleria.raise error with try/catch block like suggested in http://getsatisfaction.com/galleria/topics/could_not_extract_width_heigh...

amirtaiar’s picture

@pivica I didnt understand what is the final sintax.
Can you upload the full one?

Thank you

pivica’s picture

Here it is. Changes are on line 4796 and 4797. That two lines are changed with this

try { 
  $('<img/>').attr('src',$(img).attr("src")).load(function() {complete.call( this )})
} catch(error_message) { 
  Galleria.raise('Could not extract width/height from image: ' + img.src + 
    '. Traced measures: width:' + img.width + 'px, height: ' + img.height + 'px.'); 
}
amirtaiar’s picture

Thank you.
Unfortunately I am still getting the same error..

vb’s picture

Run in the same issue. The thread helps to find a solution.
No need to patch the js file, just add to your css

.galleria-content img {
max-width: none !important;
}

alexberendei’s picture

that worked for me, thx

ergophobe’s picture

Unfortunately, I've tried both the try/catch fix (#24) and the max-width:none fix (#26) (see my previous thread in #1402952). I've also tried running galleria 1.2.7a2 with and without the try/catch fix.

Firefox, Chrome, Opera all work okay, but no version of IE works at all. At this point, I think I just have to give up on Galleria. Too bad, it's a nice script when it works.

It may help someone to note related/dupes of this here (all mentioned already I think, but just to have them conveniently together)

#1402952

#1313054

https://getsatisfaction.com/galleria/topics/could_not_extract_width_heig...

At this point, I'm just looking for a Galleria alternative.

bryancasler’s picture

IE9 Works

rogerex’s picture

Arigato!

Thanks for your help, it work on ie8

ispboy’s picture

upgraded to the latest galleria (1.2.8), it works fine.

Omar Alahmed’s picture

#18 worked for me. I'm using zen theme, and it added in its normalize.css

img {
  border: 0; /* 1 */
  -ms-interpolation-mode: bicubic; /* 2 */

  /* vertical-align: bottom; */ /* Suppress the space beneath the baseline */

  /* Responsive images */
  /* @todo Add responsive embedded video. */
  max-width: 100%;
  height: auto;
}

after removing the width and height, it worked.

Minotaur Wrangler’s picture

I was fairly new to the Drupal community when I posted this. Following up a few things. Shortly after this post I gave up on Galleria - even though I paid for it - and moved on to something else.

fehin’s picture

Downloaded 1.2.9 and it fixed the problem for me.

nathan.bolin’s picture

#26 worked for me, though my galleria content was wrapped in different HTML so:

.galleria-container img {
max-width: none !important;
}

Fixed broken image gallery with multiple error messages:
Could not extract width/height from image: http://www.mysite.tld/sites/default/files/styles/galleria_thumb/public/2.... Traced measures: width:0px, height: 0px.

jwilson3’s picture

Using Zen theme, but dont want to qualify the img { max-width: 100% }, the fix in #7, also mentioned in this comment here, worked perfectly:

https://getsatisfaction.com/galleria/topics/could_not_extract_width_heig...