imageprocessor

How can I chain methods depending on user input?

我的未来我决定 提交于 2021-02-05 09:36:16
问题 I have a method that I'm using to process images (rotate, filter, resize, etc). It looks like this: public Image ProcessImage(Image image, Func<ImageFactory, ImageFactory> process) { using (var imageFactory = new ImageFactory(preserveExifData: true)) { using (var imageStream = new MemoryStream()) { var loadResult = imageFactory.Load(image); var processResult = process(loadResult); processResult.Save(imageStream); return Image.FromStream(imageStream); } } } Since I'm using Func<> in this way I

A generic error occurred in GDI+ when resizing image in MemoryStream

帅比萌擦擦* 提交于 2020-01-16 03:08:13
问题 I am using ImageProcessor to process images in my website. I have this resize function : public Image ResizePhoto6version(Image img, int width, int height) { using (var ms = new MemoryStream()) { using (var imgf = new ImageFactory(false)) { imgf.Load(img) .Resize(new ResizeLayer(new Size(width, height), ResizeMode.Max)) .Save(ms); return Bitmap.FromStream(ms); } } } In the webservice, I run this code : MemoryStream ytSmallStream = new MemoryStream(); MemoryStream ytMediumStream = new

ImageProcessor.Web on .Net Core 2.0 project

流过昼夜 提交于 2019-12-25 19:35:51
问题 Can i use the imageprocessor.Web on .net Core 2.0 project even if the it's restored, targeting .NETFramework, Version=v4.6.1? Update On a fresh .Net Core 2.0 project the following Packages where installed: imageprocessor imageprocessor.web imageprocessor.web.config Normally on a Asp.net Mvc Template (framework=v4.6.1) by creating simple markup for images such as <img alt="Picture for category Electronics" src="http://localhost:15536/images/thumbs/0000005_electronics_600.jpeg?crop=0.5,0,0,0.1

Cannot access ImageProcessor .net library documentation

爷,独闯天下 提交于 2019-12-12 02:46:15
问题 Hello every one kindly help me on ImageProcessor API documentation. It is downloaded but not showing detail. Just the index of the API Documentation is visible. 回答1: From the docs Remember to r-click and unblock the file on download Windows will block chm files downloaded from the internet for security reasons. You need to unblock the file before use. 来源: https://stackoverflow.com/questions/40317802/cannot-access-imageprocessor-net-library-documentation

C# Recolored Image Pixelated

泄露秘密 提交于 2019-12-11 19:33:30
问题 I'm attempting to load an image from the filesystem, re-color it, then save it to a Stream. The images in question are fairly simple, single-color, geometric shapes. I have it working, but the resulting images are heavily pixelated along the edges. I've tried System.Drawing: var colorMap = new ColorMap { OldColor = Color.FromArgb(255, 255, 255, 255), NewColor = Color.FromArgb(255, 255, 0, 0) }; var imageAttrs = new ImageAttributes(); imageAttrs.SetRemapTable(new[] {colorMap}); var newImage =

HTTP Module intercept requests and breaks custom errors configuration

回眸只為那壹抹淺笑 提交于 2019-12-11 02:22:40
问题 I have an ASP.NET MVC 5 web application which runs locally on IIS 8.5 and after deployment, on Azure Websites - on both cases, the behavior that will be later described is the same. I configured in the web.config the following custom errors page management (it covers all my cases of custom errors and it has been tested and it's working great): <system.webServer> <httpErrors errorMode="Custom" existingResponse="Replace"> <clear /> <error statusCode="400" responseMode="ExecuteURL" path="/App

Asynchronous locking based on a key

守給你的承諾、 提交于 2019-12-03 05:06:05
问题 I'm attempting to figure out an issue that has been raised with my ImageProcessor library here where I am getting intermittent file access errors when adding items to the cache. System.IO.IOException: The process cannot access the file 'D:\home\site\wwwroot\app_data\cache\0\6\5\f\2\7\065f27fc2c8e843443d210a1e84d1ea28bbab6c4.webp' because it is being used by another process. I wrote a class designed to perform an asynchronous lock based upon a key generated by a hashed url but it seems I have

Asynchronous locking based on a key

青春壹個敷衍的年華 提交于 2019-12-02 18:22:54
I'm attempting to figure out an issue that has been raised with my ImageProcessor library here where I am getting intermittent file access errors when adding items to the cache. System.IO.IOException: The process cannot access the file 'D:\home\site\wwwroot\app_data\cache\0\6\5\f\2\7\065f27fc2c8e843443d210a1e84d1ea28bbab6c4.webp' because it is being used by another process. I wrote a class designed to perform an asynchronous lock based upon a key generated by a hashed url but it seems I have missed something in the implementation. My locking class public sealed class AsyncDuplicateLock { ///