Quantcast
Channel: magick Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 1011

Created Unassigned: Percentage Resize doesn't resize [1389]

$
0
0
While trying to improve PerceptualHash performance, I came across a couple errors. With very large images, PerceptualHash takes forever to compute. I'm submitting the errors as separate issues with the same code sample.

Resize(Percent), as seen below, doesn't change the size of the image.

```
public static ImageMagick.PerceptualHash PHash(this FileInfo file, int imageSizeConstraint = 5000)
{
if (imageSizeConstraint < 1000)
imageSizeConstraint = 1000;
using (MagickImage image = new MagickImage(file.FullName))
{
if (image.Width > imageSizeConstraint || image.Height > imageSizeConstraint)
{
double percent;
if (image.Width > image.Height)
percent = imageSizeConstraint / (double)image.Width;
else
percent = imageSizeConstraint / (double)image.Height;
Percentage p = new Percentage(percent);
image.Resize(p);
}
return image.PerceptualHash();
}
}

```


Viewing all articles
Browse latest Browse all 1011

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>