The method `void Composite(MagickImage image, MagickGeometry offset, CompositeOperator compose, string args)` is not properly checking `args` for `IsNullOrEmpty()` before calling `SetArtifact()` resulting in a `ArgumentNullException`
↧
Closed Issue: Composite( Image, Geometry, Operator, String ) not checking args for null [1387]
↧
Created Unassigned: Percent AdaptiveResize disposes image internally [1388]
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.
AdaptiveResize, as seen below, internally disposes the image when it is called. I've tried it on several images.
![Image](http://it.yoyowall.com/wallpaper/camouflage-f-22.html)
```
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);
if (percent < 0.5)
image.AdaptiveResize(new MagickGeometry(p, p));
else
image.Resize(p);
}
return image.PerceptualHash();
}
}
```
AdaptiveResize, as seen below, internally disposes the image when it is called. I've tried it on several images.
![Image](http://it.yoyowall.com/wallpaper/camouflage-f-22.html)
```
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);
if (percent < 0.5)
image.AdaptiveResize(new MagickGeometry(p, p));
else
image.Resize(p);
}
return image.PerceptualHash();
}
}
```
↧
↧
Commented Unassigned: Percent AdaptiveResize disposes image internally [1388]
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.
AdaptiveResize, as seen below, internally disposes the image when it is called. I've tried it on several images.
![Image](http://it.yoyowall.com/wallpaper/camouflage-f-22.html)
```
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);
if (percent < 0.5)
image.AdaptiveResize(new MagickGeometry(p, p));
else
image.Resize(p);
}
return image.PerceptualHash();
}
}
```
Comments: Sorry, the image link is broken, but I think the bug may show up on any image. If not I'll try to get you an image to test against.
AdaptiveResize, as seen below, internally disposes the image when it is called. I've tried it on several images.
![Image](http://it.yoyowall.com/wallpaper/camouflage-f-22.html)
```
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);
if (percent < 0.5)
image.AdaptiveResize(new MagickGeometry(p, p));
else
image.Resize(p);
}
return image.PerceptualHash();
}
}
```
Comments: Sorry, the image link is broken, but I think the bug may show up on any image. If not I'll try to get you an image to test against.
↧
Created Unassigned: Percentage Resize doesn't resize [1389]
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();
}
}
```
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();
}
}
```
↧
Edited Unassigned: Percentage Resize doesn't resize [1389]
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.
Doesn't resize no matter what image I use, but here's a link to one I've tested this on - http://www.nasa.gov/images/content/378535main_lands.jpg
```
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();
}
}
```
Resize(Percent), as seen below, doesn't change the size of the image.
Doesn't resize no matter what image I use, but here's a link to one I've tested this on - http://www.nasa.gov/images/content/378535main_lands.jpg
```
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();
}
}
```
↧
↧
Edited Unassigned: Percent AdaptiveResize disposes image internally [1388]
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.
AdaptiveResize, as seen below, internally disposes the image when it is called. I've tried it on several images.
Image I've tested against, http://www.nasa.gov/images/content/378535main_lands.jpg
```
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);
if (percent < 0.5)
image.AdaptiveResize(new MagickGeometry(p, p));
else
image.Resize(p);
}
return image.PerceptualHash();
}
}
```
AdaptiveResize, as seen below, internally disposes the image when it is called. I've tried it on several images.
Image I've tested against, http://www.nasa.gov/images/content/378535main_lands.jpg
```
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);
if (percent < 0.5)
image.AdaptiveResize(new MagickGeometry(p, p));
else
image.Resize(p);
}
return image.PerceptualHash();
}
}
```
↧
Commented Unassigned: Percent AdaptiveResize disposes image internally [1388]
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.
AdaptiveResize, as seen below, internally disposes the image when it is called. I've tried it on several images.
Image I've tested against, http://www.nasa.gov/images/content/378535main_lands.jpg
```
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);
if (percent < 0.5)
image.AdaptiveResize(new MagickGeometry(p, p));
else
image.Resize(p);
}
return image.PerceptualHash();
}
}
```
Comments: Added an image link to OP
AdaptiveResize, as seen below, internally disposes the image when it is called. I've tried it on several images.
Image I've tested against, http://www.nasa.gov/images/content/378535main_lands.jpg
```
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);
if (percent < 0.5)
image.AdaptiveResize(new MagickGeometry(p, p));
else
image.Resize(p);
}
return image.PerceptualHash();
}
}
```
Comments: Added an image link to OP
↧
Commented Unassigned: Percentage Resize doesn't resize [1389]
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.
Doesn't resize no matter what image I use, but here's a link to one I've tested this on - http://www.nasa.gov/images/content/378535main_lands.jpg
```
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();
}
}
```
Comments: Using the Resize below, it resizes properly. ``` image.Resize((int)(image.Width * percent), (int)(image.Height * percent)); ```
Resize(Percent), as seen below, doesn't change the size of the image.
Doesn't resize no matter what image I use, but here's a link to one I've tested this on - http://www.nasa.gov/images/content/378535main_lands.jpg
```
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();
}
}
```
Comments: Using the Resize below, it resizes properly. ``` image.Resize((int)(image.Width * percent), (int)(image.Height * percent)); ```
↧
Edited Unassigned: Percentage Resize doesn't resize [1389]
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.
Doesn't resize no matter what image I use, but here's a link to one I've tested this on - http://www.nasa.gov/images/content/378535main_lands.jpg
```
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();
}
}
```
I'm initially calling this method with file.PHash(1000) in a loop that increases size by 1000 up to max image size to test for a sweet spot on PerceptualHash computation time.
Resize(Percent), as seen below, doesn't change the size of the image.
Doesn't resize no matter what image I use, but here's a link to one I've tested this on - http://www.nasa.gov/images/content/378535main_lands.jpg
```
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();
}
}
```
I'm initially calling this method with file.PHash(1000) in a loop that increases size by 1000 up to max image size to test for a sweet spot on PerceptualHash computation time.
↧
↧
Commented Unassigned: Percent AdaptiveResize disposes image internally [1388]
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.
AdaptiveResize, as seen below, internally disposes the image when it is called. I've tried it on several images.
Image I've tested against, http://www.nasa.gov/images/content/378535main_lands.jpg
```
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);
if (percent < 0.5)
image.AdaptiveResize(new MagickGeometry(p, p));
else
image.Resize(p);
}
return image.PerceptualHash();
}
}
```
Comments: Are you using the latest version of Magick.NET?
AdaptiveResize, as seen below, internally disposes the image when it is called. I've tried it on several images.
Image I've tested against, http://www.nasa.gov/images/content/378535main_lands.jpg
```
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);
if (percent < 0.5)
image.AdaptiveResize(new MagickGeometry(p, p));
else
image.Resize(p);
}
return image.PerceptualHash();
}
}
```
Comments: Are you using the latest version of Magick.NET?
↧
Commented Unassigned: Percent AdaptiveResize disposes image internally [1388]
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.
AdaptiveResize, as seen below, internally disposes the image when it is called. I've tried it on several images.
Image I've tested against, http://www.nasa.gov/images/content/378535main_lands.jpg
```
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);
if (percent < 0.5)
image.AdaptiveResize(new MagickGeometry(p, p));
else
image.Resize(p);
}
return image.PerceptualHash();
}
}
```
Comments: Yes
AdaptiveResize, as seen below, internally disposes the image when it is called. I've tried it on several images.
Image I've tested against, http://www.nasa.gov/images/content/378535main_lands.jpg
```
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);
if (percent < 0.5)
image.AdaptiveResize(new MagickGeometry(p, p));
else
image.Resize(p);
}
return image.PerceptualHash();
}
}
```
Comments: Yes
↧
Edited Unassigned: Percent AdaptiveResize disposes image internally [1388]
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.
AdaptiveResize, as seen below, internally disposes the image when it is called. I've tried it on several images.
Image I've tested against, http://www.nasa.gov/images/content/378535main_lands.jpg
```
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 = imageSizeConstraint / (double)Math.Max(image.Width, image.Height);
Percentage p = new Percentage(percent);
if (percent < 0.5)
image.AdaptiveResize(new MagickGeometry(p, p));
else
image.Resize(p);
}
return image.PerceptualHash();
}
}
```
AdaptiveResize, as seen below, internally disposes the image when it is called. I've tried it on several images.
Image I've tested against, http://www.nasa.gov/images/content/378535main_lands.jpg
```
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 = imageSizeConstraint / (double)Math.Max(image.Width, image.Height);
Percentage p = new Percentage(percent);
if (percent < 0.5)
image.AdaptiveResize(new MagickGeometry(p, p));
else
image.Resize(p);
}
return image.PerceptualHash();
}
}
```
↧
Commented Unassigned: Percent AdaptiveResize disposes image internally [1388]
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.
AdaptiveResize, as seen below, internally disposes the image when it is called. I've tried it on several images.
Image I've tested against, http://www.nasa.gov/images/content/378535main_lands.jpg
```
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 = imageSizeConstraint / (double)Math.Max(image.Width, image.Height);
Percentage p = new Percentage(percent);
if (percent < 0.5)
image.AdaptiveResize(new MagickGeometry(p, p));
else
image.Resize(p);
}
return image.PerceptualHash();
}
}
```
Comments: simplified the code
AdaptiveResize, as seen below, internally disposes the image when it is called. I've tried it on several images.
Image I've tested against, http://www.nasa.gov/images/content/378535main_lands.jpg
```
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 = imageSizeConstraint / (double)Math.Max(image.Width, image.Height);
Percentage p = new Percentage(percent);
if (percent < 0.5)
image.AdaptiveResize(new MagickGeometry(p, p));
else
image.Resize(p);
}
return image.PerceptualHash();
}
}
```
Comments: simplified the code
↧
↧
Edited Unassigned: Percentage Resize doesn't resize [1389]
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.
Doesn't resize no matter what image I use, but here's a link to one I've tested this on - http://www.nasa.gov/images/content/378535main_lands.jpg
```
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 = imageSizeConstraint / (double)Math.Max(image.Width, image.Height);
Percentage p = new Percentage(percent);
image.Resize(p);
}
return image.PerceptualHash();
}
}
```
I'm initially calling this method with file.PHash(1000) in a loop that increases size by 1000 up to max image size to test for a sweet spot on PerceptualHash computation time.
Resize(Percent), as seen below, doesn't change the size of the image.
Doesn't resize no matter what image I use, but here's a link to one I've tested this on - http://www.nasa.gov/images/content/378535main_lands.jpg
```
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 = imageSizeConstraint / (double)Math.Max(image.Width, image.Height);
Percentage p = new Percentage(percent);
image.Resize(p);
}
return image.PerceptualHash();
}
}
```
I'm initially calling this method with file.PHash(1000) in a loop that increases size by 1000 up to max image size to test for a sweet spot on PerceptualHash computation time.
↧
Commented Unassigned: Percentage Resize doesn't resize [1389]
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.
Doesn't resize no matter what image I use, but here's a link to one I've tested this on - http://www.nasa.gov/images/content/378535main_lands.jpg
```
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 = imageSizeConstraint / (double)Math.Max(image.Width, image.Height);
Percentage p = new Percentage(percent);
image.Resize(p);
}
return image.PerceptualHash();
}
}
```
I'm initially calling this method with file.PHash(1000) in a loop that increases size by 1000 up to max image size to test for a sweet spot on PerceptualHash computation time.
Comments: Simplified the code
Resize(Percent), as seen below, doesn't change the size of the image.
Doesn't resize no matter what image I use, but here's a link to one I've tested this on - http://www.nasa.gov/images/content/378535main_lands.jpg
```
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 = imageSizeConstraint / (double)Math.Max(image.Width, image.Height);
Percentage p = new Percentage(percent);
image.Resize(p);
}
return image.PerceptualHash();
}
}
```
I'm initially calling this method with file.PHash(1000) in a loop that increases size by 1000 up to max image size to test for a sweet spot on PerceptualHash computation time.
Comments: Simplified the code
↧
Edited Issue: Percent AdaptiveResize disposes image internally [1388]
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.
AdaptiveResize, as seen below, internally disposes the image when it is called. I've tried it on several images.
Image I've tested against, http://www.nasa.gov/images/content/378535main_lands.jpg
```
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 = imageSizeConstraint / (double)Math.Max(image.Width, image.Height);
Percentage p = new Percentage(percent);
if (percent < 0.5)
image.AdaptiveResize(new MagickGeometry(p, p));
else
image.Resize(p);
}
return image.PerceptualHash();
}
}
```
AdaptiveResize, as seen below, internally disposes the image when it is called. I've tried it on several images.
Image I've tested against, http://www.nasa.gov/images/content/378535main_lands.jpg
```
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 = imageSizeConstraint / (double)Math.Max(image.Width, image.Height);
Percentage p = new Percentage(percent);
if (percent < 0.5)
image.AdaptiveResize(new MagickGeometry(p, p));
else
image.Resize(p);
}
return image.PerceptualHash();
}
}
```
↧
Commented Issue: Percent AdaptiveResize disposes image internally [1388]
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.
AdaptiveResize, as seen below, internally disposes the image when it is called. I've tried it on several images.
Image I've tested against, http://www.nasa.gov/images/content/378535main_lands.jpg
```
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 = imageSizeConstraint / (double)Math.Max(image.Width, image.Height);
Percentage p = new Percentage(percent);
if (percent < 0.5)
image.AdaptiveResize(new MagickGeometry(p, p));
else
image.Resize(p);
}
return image.PerceptualHash();
}
}
```
Comments: It looks like it is not clear to you how percentage works. You should multiply `percent` by 100. 50% is 50 not 0.5
AdaptiveResize, as seen below, internally disposes the image when it is called. I've tried it on several images.
Image I've tested against, http://www.nasa.gov/images/content/378535main_lands.jpg
```
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 = imageSizeConstraint / (double)Math.Max(image.Width, image.Height);
Percentage p = new Percentage(percent);
if (percent < 0.5)
image.AdaptiveResize(new MagickGeometry(p, p));
else
image.Resize(p);
}
return image.PerceptualHash();
}
}
```
Comments: It looks like it is not clear to you how percentage works. You should multiply `percent` by 100. 50% is 50 not 0.5
↧
↧
Closed Issue: Percent AdaptiveResize disposes image internally [1388]
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.
AdaptiveResize, as seen below, internally disposes the image when it is called. I've tried it on several images.
Image I've tested against, http://www.nasa.gov/images/content/378535main_lands.jpg
```
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 = imageSizeConstraint / (double)Math.Max(image.Width, image.Height);
Percentage p = new Percentage(percent);
if (percent < 0.5)
image.AdaptiveResize(new MagickGeometry(p, p));
else
image.Resize(p);
}
return image.PerceptualHash();
}
}
```
AdaptiveResize, as seen below, internally disposes the image when it is called. I've tried it on several images.
Image I've tested against, http://www.nasa.gov/images/content/378535main_lands.jpg
```
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 = imageSizeConstraint / (double)Math.Max(image.Width, image.Height);
Percentage p = new Percentage(percent);
if (percent < 0.5)
image.AdaptiveResize(new MagickGeometry(p, p));
else
image.Resize(p);
}
return image.PerceptualHash();
}
}
```
↧
Commented Issue: Percent AdaptiveResize disposes image internally [1388]
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.
AdaptiveResize, as seen below, internally disposes the image when it is called. I've tried it on several images.
Image I've tested against, http://www.nasa.gov/images/content/378535main_lands.jpg
```
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 = imageSizeConstraint / (double)Math.Max(image.Width, image.Height);
Percentage p = new Percentage(percent);
if (percent < 0.5)
image.AdaptiveResize(new MagickGeometry(p, p));
else
image.Resize(p);
}
return image.PerceptualHash();
}
}
```
Comments: The next version of Magick.NET will throw an ArgumentException when you create a geometry that has a with and height of zero.
AdaptiveResize, as seen below, internally disposes the image when it is called. I've tried it on several images.
Image I've tested against, http://www.nasa.gov/images/content/378535main_lands.jpg
```
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 = imageSizeConstraint / (double)Math.Max(image.Width, image.Height);
Percentage p = new Percentage(percent);
if (percent < 0.5)
image.AdaptiveResize(new MagickGeometry(p, p));
else
image.Resize(p);
}
return image.PerceptualHash();
}
}
```
Comments: The next version of Magick.NET will throw an ArgumentException when you create a geometry that has a with and height of zero.
↧
Edited Issue: Percentage Resize doesn't resize [1389]
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.
Doesn't resize no matter what image I use, but here's a link to one I've tested this on - http://www.nasa.gov/images/content/378535main_lands.jpg
```
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 = imageSizeConstraint / (double)Math.Max(image.Width, image.Height);
Percentage p = new Percentage(percent);
image.Resize(p);
}
return image.PerceptualHash();
}
}
```
I'm initially calling this method with file.PHash(1000) in a loop that increases size by 1000 up to max image size to test for a sweet spot on PerceptualHash computation time.
Resize(Percent), as seen below, doesn't change the size of the image.
Doesn't resize no matter what image I use, but here's a link to one I've tested this on - http://www.nasa.gov/images/content/378535main_lands.jpg
```
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 = imageSizeConstraint / (double)Math.Max(image.Width, image.Height);
Percentage p = new Percentage(percent);
image.Resize(p);
}
return image.PerceptualHash();
}
}
```
I'm initially calling this method with file.PHash(1000) in a loop that increases size by 1000 up to max image size to test for a sweet spot on PerceptualHash computation time.
↧