imageresizer

ImageResizer return closest image breakpoint

别说谁变了你拦得住时间么 提交于 2019-12-11 14:52:06
问题 Like @Nathanael Jones answered here ImageResizer library have "Presets" to create some kind of breakpoints. I want have breakpoints as I mentioned on my other question: 1º - 320w- 213h 2º - 453w- 302h 3º - 579w- 386h and so on.. My question is can I request an image like "?w=300&h=200" , and return my closest breakpoint, in this case was first one. 回答1: There's nothing built-in to pick presets for you, or "snap" to the closest one. That said, it's easy to implement using the Config.Current

ImageResizer web.config rewrite rule not working properly

雨燕双飞 提交于 2019-12-11 14:34:36
问题 I am using ImageResizer to read images from my Amazon S3, with this rule it is working great: <rewrite> <rules> <rule name="Rewrite to s3" stopProcessing="true"> <match url="^(.*)/(productimages)/(.*)" /> <action type="Rewrite" url="{R:1}/mybucketname/{R:3}" appendQueryString="true" redirectType="Found" /> </rule> </rules> </rewrite> For this URL: http://localhost:7514/s3/productimages/112/0718877-21_lg.jpg Loads this image form Amazon S3: http://localhost:7514/s3/mybucketname/112/0718877-21

Image Resizer - Best Practice for security

喜欢而已 提交于 2019-12-11 13:13:50
问题 We are currently testing out Image Resizer library and one of the questions is, how do we avoid malicious attacks to the site if someone programmically send thousands of resizing requests of images with arbitrary sizes to the server, overloading the CPU/RAM of server and potentially causing disk space to run out due to tremendous caching files. Is there any way to whitelisting certain dimensions? Or what is the best practice to avoid this scenario? Thanks! Stephen 回答1: Neither CPU or RAM can

ImageResizer S3Reader2 Plugin 404 Error after image has been uploaded

眉间皱痕 提交于 2019-12-11 09:16:47
问题 We have been using ImageResizer serving images from disk for quite a while and it has been a great product for us! Now we are trying to upgrade services to scale and using S3 for storage and running into a major issue for us. If the image does not exist at S3 there is an AWSSDK error being thrown, that looks like is then preventing the image from ever being loaded through ImageResizer and continues to throw 404 even after the image has been loaded to S3. To replicate the problem simply have

ImageResizer and VS 2015

耗尽温柔 提交于 2019-12-11 06:45:52
问题 I have a project that was created using Visual Studio 2015. These projects don't use web.configs to my knowledge. Having uses ImageResizer before, I wanted to use it in this project but because there is no web.config I can't get it to work Has anyone used ImageResizer in a VS 2015 project? If so, how did you get it to work? 回答1: I'm also curious to know if there's a way to use ImageResizer with ASP.NET 5 and the new web.config-less project structure. Nathanel Jones should know the answer. 来源:

Image Resizer User.Identity in eventhandler

冷暖自知 提交于 2019-12-11 04:17:51
问题 Added an AuthorizeImage eventhandler to image access restriction. Noticed the following when i was trying to check the users name and authenticationstatus: Below will not result in exception, but seem to break it. Default icon for image not found is displayed no matter authenticated or not. Tested this.User = same result. HttpContext.Current.User = same result Config.Current.Pipeline.AuthorizeImage += delegate(IHttpModule sender, HttpContext context, IUrlAuthorizationEventArgs e) { if

Just updated ImageResizer via NuGet, can't run app because it can't find BundleAttribute

一曲冷凌霜 提交于 2019-12-10 20:09:50
问题 I was just trying to update Azure Storage, but doing that meant I needed to update the ImageResizer AzureReader and update the app to use .Net 4.5.2 (the Azure site is set for .Net 4.6). Now I've got everything at the newest version; I've cleaned and rebuilt the app. It works fine locally, but when I publish it to Azure, I get the following error. I can not get the diagnostics page to load. Server Error in '/' Application. Could not load type 'ImageResizer.Util.BundleAttribute' from assembly

Resizing image proportionally in ASP.NET C# by specifying either Height or Width

牧云@^-^@ 提交于 2019-12-09 07:18:07
问题 I need a code that will allow me to resize images, but with the following functionality: 1) resize image upon upload 2) Resize image proportionally by specifying either height or width. Note: Should be done in ASP.NET C# For example: The function should get the a width OR a height, and resize the image proportionally for the give height OR Width. Let's say that the image is 400(w)x100(h). I want to tell the function to resize the image to a specific height, let's say 80px. The function should

Best way to get image dimensions using ImageResizer

拈花ヽ惹草 提交于 2019-12-09 03:50:45
问题 I am switching an existing MVC 4 website from home-cooked user file uploads to resizing files with ImageResizer as they are uploaded. I see in the documentation that I should not use System.Drawing, but I can't figure out any other way of grabbing the image dimensions. It does not matter if the dimensions are from the original image or a resized image, since I am preserving aspect ratio and merely need to determine if an image is landscape or portrait. I am adding the code here that I refer

Dynamic image resizing in the Cloud for Responsive website

扶醉桌前 提交于 2019-12-07 15:16:32
I have a responsive (RWD) website which works OK on mobile devices. My problem is that pictures are sort of "heavy" on smartphones and uselessly large on older phones. I know there are plenty of tools either offline or online (such as: http://www.resizeyourimage.com/ ) to resize pictures and I know I could roll my own image resizer with GD and the like (PHP here), but I was wondering if someone here is aware of a way to have images automatically resized. For example by piping them through a proxy of some kind, such as: http://cloudservice/w_320/http://myserver/mypic.jpg" /> A free service