Forums

Galleria displaying error after moving host (2 posts)

  1. canchuckwood
    Member
    Posted 5 months ago #

    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

  2. canchuckwood
    Member
    Posted 5 months ago #

    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

Reply

You must log in to post.

About this Topic