Check if images is exactly the same.
@return bool
770006
public function isEqual()
    {
        // CHECK IMAGES DIMENSIONS
        if(!$this->isDimensionsEqual())
        {
            return FALSE;
        }

        $compare = $this->image1->compareImages($this->image2, Imagick::METRIC_MEANSQUAREERROR);

        // IMAGE IS EXACTLY THE SAME
        if($compare === TRUE)
        {
            return TRUE;
        }
        // IMAGE IS IN TOLERABLE RANGE
        elseif($compare)
        {
            if($compare[1] < $this->tolerance)
            {
                return TRUE;
            }
        }

        return FALSE;
    }
940265
protected function image_element_original() {
    $path = $this->get_original_image_path();
    $class = $this->get_class();

    $data['src'] = $this->generateUrl($path);
    $data['img'] = '<img src="'. $data['src'] .'"'. $class .' alt="'. $this->alt .'" title="'. $this->title .'"/>';
    $data['img_nosize'] = '<img src="'. $data['src'] .'"'. $class .' alt="'. $this->alt .'" title="'. $this->title .'"/>';

    return (object) $data;
  }
1103450
public function nameExists()
    {
        $name = (string) $this->getRequiredParameter('name');
        if (empty($name))
            return false;

        return array_key_exists($name, $this->_imageNames);
    }
1074895
final public function hasUTF()
    {
        $verParts = explode('.', $this->getVersion());
        return ($verParts[0] == 5 || ($verParts[0] == 4 && $verParts[1] == 1 && (int)$verParts[2] >= 2));
    }
1329405
public function isImage(): bool
    {
        return is_resource($this->content) && in_array($this->contentType, [
            self::CONTENT_TYPE_IMAGE_JPEG, self::CONTENT_TYPE_IMAGE_PNG, self::CONTENT_TYPE_IMAGE_GIF,
        ]);
    }
634942
protected function validateImageStyle()
    {
        $id = $this->getUpdatingId();

        if ($id === false) {
            return null;
        }

        $data = $this->image_style->get($id);

        if (empty($data)) {
            $this->setErrorUnavailable('update', $this->translation->text('Image style'));
            return false;
        }

        $this->setSubmitted('update', $data);
        return true;
    }
353821
public function isMatching()
    {
        $condition1 = $this->conditionValidator->variableOpComparison(
            $this->facade->getCartTotalTaxPrice(),
            $this->operators[self::CART_TOTAL],
            $this->values[self::CART_TOTAL]
        );

        if ($condition1) {
            $condition2 = $this->conditionValidator->variableOpComparison(
                $this->facade->getCheckoutCurrency(),
                $this->operators[self::CART_CURRENCY],
                $this->values[self::CART_CURRENCY]
            );

            if ($condition2) {
                return true;
            }
        }

        return false;
    }
1082082
public static function isUnix() : bool
    {
        // Return the cached result if it's already available.
        if (null !== static::$type) {
            return static::$type === self::TYPE_UNIX;
        }

        return static::getType() === self::TYPE_UNIX;
    }
333686
public function isMetaImageFileLink()
    {
        if ($this->owner->hasMetaImage()) {
            return ($this->owner->getMetaImageLink() == $this->owner->getMetaImageURL());
        }
        
        return false;
    }
183215
public function isVersioned()
    {
        if (!$this->ObjectClass || !class_exists($this->ObjectClass)) {
            return false;
        }
        /** @var Versioned|DataObject $singleton */
        $singleton = DataObject::singleton($this->ObjectClass);
        return $singleton->hasExtension(Versioned::class) && $singleton->hasStages();
    }
812726
public function areEqual()
    {
        return $this->valid()
            ? $this->lhs->current() == $this->rhs->current()
            && $this->lhs->key() == $this->rhs->key()
            : $this->lhs->valid() == $this->rhs->valid();
    }
923846
def check_images(img_spec1, img_spec2, bkground_thresh=0.05):
    """"""

    img1 = read_image(img_spec1, bkground_thresh)
    img2 = read_image(img_spec2, bkground_thresh)

    if img1.shape != img2.shape:
        raise ValueError('size mismatch! First image: {} Second image: {}\n'
                         'Two images to be compared must be of the same size in all dimensions.'.format(
            img1.shape,
            img2.shape))

    return img1, img2
839845
public function isAdminHome(): bool
    {
        return $this->url->current() == $this->url->to($this->config->get('helpers.paths.admin'));
    }
216367
public function match($data)
    {
        if (!($data instanceof ModuleInterface)) {
            return false;
        }

        $files = $data->getFiles();

        return !empty($files);
    }
776453
public function compare(Image $image) {
		$hash1 = $this->getHashValue();
		$hash2 = $image->getHashValue();
		if (strlen($hash1) !== strlen($hash2)) {
			return false;
		}
		$count = 0;
		$len = strlen($hash1);
		for ($i = 0; $i < $len; $i++) {
			if ($hash1[$i] !== $hash2[$i]) {
				$count++;
			}
		}
		return $count <= 10;
	}
428474
private function isLocalFile()
    {
        try {
            if (file_exists(storage_path('app/'.$this->location))) {
                return true;
            }
        } catch (Exception $e) {
            Log::debug('Could not find the image');

            return false;
        }

        return false;
    }
1051215
public static function isJustInstalled()
    {
        $types = Type::find()->all();
        $categories = Category::find()->all();

        return empty($types) || empty($categories) ? : false;
    }