This is a relatively minor concern, but if you create an image gallery and then visit that gallery before there are any images in it, you get this error coming up:

getimagesize(): Read error! [path to image module]

It will come up once for every gallery without any images.

When the error occurs, it also seems to destroy font-size settings for that page load (a peculiar side effect, even if it isn't important).

CommentFileSizeAuthor
#1 image-empty-gallery.patch1.34 KBRobrecht Jacques

Comments

Robrecht Jacques’s picture

StatusFileSize
new1.34 KB

If you don't have an empty gallery, and you go to it's page (image/tid/XXX) then nothing will be shown! Probably because image_page returns an empty string in this case.

An easy fix is attached.

Another way of correcting this, is making sure that $gallery->latest in image_page is only set when there is actually an image in the gallery (or subgalleries).

I think however there is also a small problem in includes/image.inc in drupal-core. What image_get_info does is checking whether the file exists, but it should also check if the file is in fact a real file and not a directory. That is what is causing the error to appear. Of course image.module shouldn't ask for this info in the first place (it is asking the info of the files directory btw).

Robrecht

syscrusher’s picture

I can replicate this error, and I have also verified that the patch from robrechtj fixes it on my sites. +1 for the patch. :-)

Scott

CdnStrangequark’s picture

Sorry for the delay in responding.

I tried to apply the patch but it fails everytime. It may be because I already applied the Mozilla browser patch. It seems you can't patch something twice.

Robrecht Jacques’s picture

Well, patching something twice sometimes (most of the time) works as long as the lines you are patching are not the same.

Maybe you can apply the patch manually. In "function theme_image_gallery" you need to insert a "if ($gallery->count) {...}" at the right place. I hope it is clear from the patch which line you need to change.

Kr,
Robrecht

walkah’s picture

committed - thanks :)

Anonymous’s picture