• Hi folks

    I recently shifted my entire site to a different server (same domain name). Everything worked fine, except the Galleria plugin is now displaying the following error on every post which has it (which is most of them).

    Warning: getimagesize() [function.getimagesize]: Filename cannot be empty in /home4/****/public_html/*****/wp-content/plugins/galleria-wp/galleria-wp.php on line 1246

    And it repeats the same error about a dozen times on each post.

    The odd thing is, the gallery is still working perfecty beneath all the errors.

    Anyone have any suggestions as to how I can get rid of the errors? I’ve had to put a password on the site, and its a popular site so I’d like to get it fixed asap.

    Thanks
    Charlette

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter canchuckwood

    (@canchuckwood)

    Further, I have found the following with getimagesize:

    function _wp_get_attachment_image_src( $attachment_id,
    									   $size='thumbnail',
    									   $icon = false ) {
    	// get a thumbnail or intermediate image if there is one
    	if ( $image = _image_downsize($attachment_id, $size) )
    		return $image;
    	if ( $icon && $src = wp_mime_type_icon($attachment_id) ) {
    		$icon_dir =
    			apply_filters( 'icon_dir', ABSPATH . WPINC . '/images/crystal' );
    		$src_file = $icon_dir . '/' . basename($src);
    	@list($width, $height) = getimagesize($src_file);
    	}
    	if ( $src && $width && $height )
    		return array( $src, $width, $height );
    	return false;
    }

    and

    function _image_downsize($id, $size = 'medium') {
    	if ( !wp_attachment_is_image($id) )
    		return false;
    	$img_url = wp_get_attachment_url($id);
    	$meta = wp_get_attachment_metadata($id);
    	$width = $height = 0;
    	// plugins can use this to provide resize services
    	if ( $out = apply_filters('_image_downsize', false, $id, $size) )
    		return $out;
    	// try for a new style intermediate size
    	if ( $intermediate = image_get_intermediate_size($id, $size) ) {
    		$img_url = str_replace(basename($img_url), $intermediate['file'], $img_url);
    		$width = $intermediate['width'];
    		$height = $intermediate['height'];
    	}
    	elseif ( $size == 'thumbnail' ) {
    		// fall back to the old thumbnail
    		$thumb_file = wp_get_attachment_thumb_file( $id ); // modified by Y2
    		if ( $info = getimagesize($thumb_file) ) {		   //
    			$img_url = str_replace(basename($img_url), basename($thumb_file), $img_url);
    			$width = $info[0];
    			$height = $info[1];
    		}
    	}
    	if ( !$width && !$height && isset($meta['width'], $meta['height']) ) {
    		// any other type: use the real image and constrain it
    		list( $width, $height ) =
    			 image_constrain_size_for_editor( $meta['width'],
    											  $meta['height'], $size );
    	}
    	if ( $img_url)
    		return array( $img_url, $width, $height );
    	return false;
    }

    There doesn’t seem to be any gaps, but I don’t know much about php, so I can’t figure out why it is displaying this error at the same time as working perfectly. Any help is really appreciated.

    Charlette

    I know this is 10 months old, but in case anyone else has the same issue and is looking for a solution…

    I’ve been using this plug-in for a couple of months without any problems, then all of a sudden I started having this problem today after uploading a bunch of pictures, no idea why!!! As the OP says, the slide show was working perfectly, but it still displayed that “Warning: getimagesize() [function.getimagesize]: Filename cannot be empty in…..” error message on every page with new pictures.

    I was about to give up when my husband came to the rescue and found this solution – at least it works for me, slide-show working beautifully again and error messages have gone!!

    – Find the galleria-wp.php file.
    – Scroll all the way to the bottom to lines 1245 + 1246, they should read:

    $thumb_file = wp_get_attachment_thumb_file( $id ); // modified by Y2
    if ( $info = getimagesize($thumb_file) ) { //

    Highlight and replace both lines with this one line:

    if ( ($thumb_file = wp_get_attachment_thumb_file($id)) && $info = getimagesize($thumb_file) ) { //

    That’s it! Don’t forget to save the changes ??

    kittiekat, your husband rocks. Fixed the issue for me!

    Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Galleria displaying error after moving host’ is closed to new replies.