Check if the given image format is static WebP (not animated).

@param imageFormat the image format to check
@return true if static WebP
189883
public static boolean isStaticWebpFormat(ImageFormat imageFormat) {
    return imageFormat == WEBP_SIMPLE ||
        imageFormat == WEBP_LOSSLESS ||
        imageFormat == WEBP_EXTENDED ||
        imageFormat == WEBP_EXTENDED_WITH_ALPHA;
  }
396286
public function setImageFormat($imageformat,$pngScaleFactor = null){
        if($imageformat == self::$IMAGE_FORMAT_JPEG){
            $this->imageDeviceCommand = "jpeg";
            $this->imageExtention="jpg";
            $this->pngDownScaleFactor = isset($pngScaleFactor) ? "-dDownScaleFactor=".$pngScaleFactor : "";
        }else if($imageformat == self::$IMAGE_FORMAT_PNG){
            $this->imageDeviceCommand = "png16m";
            $this->imageExtention="png";
            $this->pngDownScaleFactor = "";
        }
        return $this;
    }
457959
public Format decideTextureFormat(Format fmt) {
        switch (colorType) {
        case COLOR_TRUECOLOR:
        	if ((fmt == ABGR) || (fmt == RGBA) || (fmt == BGRA) || (fmt == RGB)) {
        		return fmt;
        	}
            
        	return RGB;
        case COLOR_TRUEALPHA:
        	if ((fmt == ABGR) || (fmt == RGBA) || (fmt == BGRA) || (fmt == RGB)) {
        		return fmt;
        	}
            
        	return RGBA;
        case COLOR_GREYSCALE:
        	if ((fmt == LUMINANCE) || (fmt == ALPHA)) {
        		return fmt;
        	}
            
        	return LUMINANCE;
        case COLOR_GREYALPHA:
            return LUMINANCE_ALPHA;
        case COLOR_INDEXED:
        	if ((fmt == ABGR) || (fmt == RGBA) || (fmt == BGRA)) {
        		return fmt;
        	}
        	
        	return RGBA;
        default:
            throw new UnsupportedOperationException("Not yet implemented");
        }
    }
214618
public void setData(BufferedImage image, String imageFormat)
			throws IOException {
		setData(image, imageFormat, null);
	}
1233695
private boolean isJawrImageTag(ComponentTag tag) {
		String tagName = tag.getName();
		return (tagName.equalsIgnoreCase("img") || (tagName
				.equalsIgnoreCase("input") && tag.getAttribute("type").equals(
				"image")));
	}
570392
public static boolean isFormatDita(final String attrFormat) {
        if (attrFormat == null || attrFormat.equals(ATTR_FORMAT_VALUE_DITA)) {
            return true;
        }
        for (final String f : ditaFormat) {
            if (f.equals(attrFormat)) {
                return true;
            }
        }
        return false;
    }
880974
public final PageStyleBuilder paperFormat(
			final PaperFormat paperFormat) {
		this.paperFormat = paperFormat;
		this.pageWidth = paperFormat.getWidth();
		this.pageHeight = paperFormat.getHeight();
		return this;
	}
1190324
public static boolean isMultiPartForm(@CheckForNull String contentType) {
        if (contentType == null) {
            return false;
        }

        String[] parts = contentType.split(";");
        return ArrayUtils.contains(parts, "multipart/form-data");
    }
584879
public boolean isSingleDataImage()
    {
    	if (this.getScreenField().getConverter() != null)
        	if (this.getScreenField().getConverter().getField() != null)
            	if (this.getScreenField().getConverter().getField().getComponent(1) == null)
    		return true;
    	return false;
    }
56971
public static function is_image($image, $format = null, $returnBase64Encode = false)
    {
        // url file content
        if (is_string($image)) {
            if (!static::is_url($image) && !static::is_file($image)) {
                /**
                 * 既不是 url 也不是 file.
                 */
                $content = $image;
                $image = @getimagesizefromstring($image);
            } else {
                $content = file_get_contents($image);
                $image = @getimagesize($image);
            }
        } elseif (self::is_splFileInfo($image)) {
            /*
             * SplFileInfo -> file
             */
            $file = $image->getRealPath();
            $image = @getimagesize($file);
            $content = file_get_contents($file);
        } elseif (is_resource($image)) {
            $content = stream_get_contents($image);
            $image = @getimagesizefromstring($content);
        } else {
            $image = false;
            $content = null;
        }

        $content = base64_encode($content);

        $bool = $image !== false;

        if (!$bool) {
            return false;
        }

        if (is_null($format)) {
            // not check format
            if ($returnBase64Encode) {
                return $content;
            }

            return true;
        }

        // check format

        if (is_array($format)) {
            $bool = in_array(static::getImageFormat($image), $format);
        } else {
            $bool = static::getImageFormat($image) === $format;
        }

        if (!$bool) {
            return false;
        }

        if ($returnBase64Encode) {
            return $content;
        }

        return true;
    }
1018453
function (format) {
        if (!this.image || !this.size) return null;

        format = format || "image/png";
        var canvas = document.createElement("canvas");
        var context = canvas.getContext("2d");
        context.canvas.width = this.size.w;
        context.canvas.height = this.size.h;

        var imgData = context.createImageData(this.size.w, this.size.h);
        for (var i = 0; i < this.image.length; i++) {
            imgData.data[i] = this.image[i];
        }
        context.putImageData(imgData, 0, 0);
        
        return canvas.toDataURL(format);
    }
86959
private function checkImageAltTags() {

        $html = $this->getPageContent();

        // for newly created page
        if ($html == '') {
            return false;
        }

        $dom = $this->createDOMDocumentFromHTML($html);

        $images = $dom->getElementsByTagName('img');

        $imagesWithAltTags = 0;
        foreach($images as $image){
            if($image->hasAttribute('alt') && $image->getAttribute('alt') != ''){
                $imagesWithAltTags++;
            }
        }
        if($imagesWithAltTags == $images->length){
            return true;
        }

        return false;
    }
1079126
public static boolean isImage( File file ){
		try {
			String mimeType = Files.probeContentType(file.toPath());
			if( mimeType == null ) {
				// In some OS there is a bug where it always returns null/
				String extension = FilenameUtils.getExtension(file.getName()).toLowerCase();
				String[] suffixes = ImageIO.getReaderFileSuffixes();
				for( String s : suffixes ) {
					if( s.equals(extension)) {
						return true;
					}
				}
			} else {
				return mimeType.startsWith("image");
			}
		} catch (IOException ignore) {}
		return false;
	}
332598
private boolean isImageType(String mime) {
		if (StringUtils.hasText(mime)) {
			for (String imageMime : IMAGE_MIMES) {
				if (mime.equalsIgnoreCase(imageMime)) {
					return true;
				}
			}
		}
		return false;
	}
56420
protected function _isValidFormat()
	{
		//	Reading 2048 bytes should be enough to validate that the format is HTML
		$data = fread($this->_fileHandle, 2048);
		if ((strpos($data, '<') !== FALSE) &&
			(strlen($data) !== strlen(strip_tags($data)))) {
			return TRUE;
		}

		return FALSE;
	}
1256163
public static boolean isInlineModeAllowed(Element img, InlineMode mode) {
		// if already inlined => reject (do not inline twice)
		if (!img.attr(INLINED_ATTR).isEmpty()) {
			return false;
		}
		// if inline mode defined but not the wanted mode => reject
		if (!img.attr(INLINE_MODE_ATTR).isEmpty() && !img.attr(INLINE_MODE_ATTR).equals(mode.mode())) {
			return false;
		}
		// if inline mode defined and matches the wanted mode => allow
		// if no inline mode defined => allow (any mode allowed)
		return true;
	}
773289
private function isNotSmallerThanFormat($width, $height, array $format)
    {
        if (isset($format['scale']['x']) && $width < $format['scale']['x']) {
            return false;
        }
        if (isset($format['scale']['y']) && $height < $format['scale']['y']) {
            return false;
        }

        return true;
    }