Using ImageResizing with a custom naming convention

主宰稳场 提交于 2019-12-11 19:29:04

问题


Hi I was looking in the imageresizing.net project to see if there is a plugin that handle this but I didnt find it.

I need to set up imageresizer to handle images with prefix, the prefix will define the size and different properties of the resized image.

Example is on disk we have the image /Images/Folder1/12345.jpg So the request would be like /Images/Folder1/small_12345.jpg

So i need to handle the request, take the prefix (small in this case) and based on an xml decide what properties apply to the original image, transforming that to /Images/Folder1/12345.jpg?w=100&h=75...

This bacause we already have that naming convention and we dont want to change that from our web app, but we are moving from have a batch processing of images everyday to do it on the fly with image resizer.

So the question is there a plugin for something like this or what solution do you recommend? I was thinking on create an httpmodule wrapper that intercept this kind of image names, read the configuration from the xml based on the prefix and call the new url with the image resizer format, thing is I dont want to redirect the user.

Thanks


回答1:


This is basic URL rewriting - you can do it with any URL rewriting module, or using ImageResizer's own URL rewriting API - the Rewrite event.

The FolderResizeSyntax plugin is an example of this.



来源:https://stackoverflow.com/questions/18774853/using-imageresizing-with-a-custom-naming-convention

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!