resize images library? Options
desmo
Posted: Friday, February 09, 2007 12:02:11 AM

Rank: Aficionado

Joined: 7/19/2006
Posts: 144
Location: NYC
bob baty-barr wrote:

okay, that didn't work for me... what the heck is that setting for anyway?


2 of those web.config settings are a bit mysterious to me also:
umbracoReservedUrls, umbracoReservedPath

:hmm:

- Mark


Manhattan Heavy Industries

“Algorithms are small but beautiful”, Dr. Karp observed.
Gregorius
Posted: Friday, February 09, 2007 12:30:59 AM

Rank: Aficionado

Joined: 7/29/2006
Posts: 491
Location: Melbourne, Australia
phazer wrote:

I think that adding a configuration file would solve the problem. Maybe it's possible to make it so, that ImageGen accepts querystring properties by default, but if you set a property in the configuration file, it doesn't accept querystring properties anymore.

This way, ImageGen is still backwards compatible and very easy to integrate (if you don't mind about the potential risk) and if you do mind, just use the configuration file to override the querystring properties.


Excuse my ignorance, but what exactly would be the use of ImageGen without the ability to use querystrings to dynamically alter the size of an image? isn't that the core functionality of imagegen, or is there another way to resize images, without using querystrings?

regarding the image cropper, there is one created by Warren Hagge - see here:
http://forum.umbraco.org/misc/image-cropper---hagge/re-image-cropper---hagge-3

i'm sure you could use that one, or extend it to your needs.. i'd be interested to know how you go with it, as its a killer feature for a website. ability to enforce aspect ratio would be a great addition to the functionality (pretty sure it doesnt have that yet.. or does it?)


Sometimes when I'm alone, I google myself...
drobar
Posted: Friday, February 09, 2007 12:50:19 AM

Rank: Umbracoholic

Joined: 9/8/2006
Posts: 1,082
Location: KY, USA
I think query string is essential for ImageGen, especially when you use XSLT to create pages, links, or place images on the fly in a page. I would certainly want ImageGen to remain backward compatible so existing users could just drop in a new version. The config file would be optional and offer some features that wouldn't make sense on a querystring. It'll take some thought to figure out which ImageGen parameters could be overridden with an explicit querystring parameter and which should use the config file settings no matter what. But I think that it's totally workable after some thought and documentation. Oh, and more development on ImageGen ;)

@Bob and Mark -> check out http://forum.umbraco.org/extending-umbraco/non-umbraco-pages-in-a-umbraco-site for info on those params in the web.config and an idea of what they do. Unfortunately, they don't do what you were hoping. But they're very powerful, just the same!

cheers,
doug.


MVP 2007/2008 - Official Umbraco Trainer for North America - Percipient Studios
phazer
Posted: Saturday, February 10, 2007 2:45:23 PM
Rank: Newbie

Joined: 2/8/2007
Posts: 3
Greg wrote:

Excuse my ignorance, but what exactly would be the use of ImageGen without the ability to use querystrings to dynamically alter the size of an image? isn't that the core functionality of imagegen, or is there another way to resize images, without using querystrings?


You'll need to use querystring properties if you use ImageGen to resize images to various sizes within your site, because you can't easily store all those different properties in one configuration file.

But if you just use ImageGen to resize to only one specific size (in my case 100x75), it would be nice if you could set a default width/height and more important, a maximum width/height in a configuration file. This way, you only need to use the querystring properties if you want to have a different size then the default.
Gregorius
Posted: Sunday, February 11, 2007 2:17:52 AM

Rank: Aficionado

Joined: 7/29/2006
Posts: 491
Location: Melbourne, Australia
ah, i'm with u phazer... what about the ability in the config file to specify allowable dimensions to resize to, that way imagegen will only resize to one of the allowed sizes, hence negating the risk of hacking??

Sometimes when I'm alone, I google myself...
bootnumlock
Posted: Sunday, February 11, 2007 2:35:41 AM

Rank: Fanatic

Joined: 10/9/2006
Posts: 317
a suggestion for the source could be to limit the size -- hard coded max height or width that could be overriden in a config???

i would guess that doug could easily implement a check to see if the size passed in query string is under hMax or vMax then allow the sizing, else Hello World

could be talkin' out my butt again.

bootnumlock - aka bob baty-barr [http://www.baty-barr.com]
jesper
Posted: Sunday, February 11, 2007 9:37:54 PM

Rank: Administration

Joined: 7/25/2006
Posts: 401
Location: vipperød, denmark
Flooding I suggest limiting the querystring parameters to an absolute minimum but adding some flexibility by using multiple config files.

imagegen.aspx?image=/media/23/jespersferrai.jpg&cfg=cars
imagegen.aspx?image=/media/23/girlonbeach.jpg&cfg=pplirespect

Maybe being able to (globally) configure which parameters is allowed from querystring is a good way of solving the different needs.

Disabling the caching could also solve it. How much processor time is actually saved using cached images?



Cropping
Being able to specify coordinates could be very cool. Positioning the cropping could be a part of the Insert Image dialog. And some ppl would probably use it on front end image galleries.


Kindly,

Jesper


webbureau jesper.com doing webdesign / development / umbraco implementations / 2007&2008 MVP
thomwhaites
Posted: Tuesday, February 27, 2007 6:19:36 PM
Rank: Fanatic

Joined: 7/20/2006
Posts: 253
Location: Boston, Massachusetts
Sorry if this question has been raised, but when imageGen resizes a picture, there seems to be a 1 pixel wide anti-aliased border along the top and left edges of the image. This doesn't look so hot when a CSS border is applied to the image.

Any way around this?

Thanks,
Tom
desmo
Posted: Tuesday, February 27, 2007 9:11:06 PM

Rank: Aficionado

Joined: 7/19/2006
Posts: 144
Location: NYC
I have never seen this. Do you have an example we can see?

- Mark

Manhattan Heavy Industries

“Algorithms are small but beautiful”, Dr. Karp observed.
thomwhaites
Posted: Tuesday, February 27, 2007 9:16:57 PM
Rank: Fanatic

Joined: 7/20/2006
Posts: 253
Location: Boston, Massachusetts
Ya, here's a particularly bad one:
http://yearofthe.com/umbraco/imageGen.aspx?image=/media/11/img_2687.jpg&width=600&pad=false&constrain=true&compression=100

and the original:

http://yearofthe.com/media/11/img_2687.jpg

Note the score mark type line along to top and left edge. This doesn't appear in all the images I've tried, but those edges don't seem to be perfectly clean/sharp in the majority of the images I've seen resized.

Tom
desmo
Posted: Wednesday, February 28, 2007 2:24:20 PM

Rank: Aficionado

Joined: 7/19/2006
Posts: 144
Location: NYC
I see what you mean. I never noticed this before, but some images on one of "my" sites are showing this too.

- Mark

Manhattan Heavy Industries

“Algorithms are small but beautiful”, Dr. Karp observed.
thomwhaites
Posted: Wednesday, February 28, 2007 2:56:37 PM
Rank: Fanatic

Joined: 7/20/2006
Posts: 253
Location: Boston, Massachusetts
It seems to make a white line in light areas and a lesser discoloration in dark areas. To my eye, if you surround the image with a css border the edges in the dark areas become more pronounced and those in the light become less so. Odd.
drobar
Posted: Wednesday, February 28, 2007 4:10:32 PM

Rank: Umbracoholic

Joined: 9/8/2006
Posts: 1,082
Location: KY, USA
I've looked into this quickly and I don't have a solution yet. There is very little processing that happens for a simple image resize and I'm using the highest quality settings to get the best results. And yet the highlight artifact appears in the first pixel of the edges. I don't have a quick solution or work-around. It may be a bug in the .NET functions I'm using.

A white border seems to minimize the visibility of the problem. Perhaps you could put a white boarder around the image using the border= and bordercolor= parameters in ImageGen, or via CSS until the problem is corrected? It is also more evident with higher quality compression, so an 80% compression quality will be a bit less obvious than 100%.

cheers,
doug.

MVP 2007/2008 - Official Umbraco Trainer for North America - Percipient Studios
cpalm
Posted: Wednesday, February 28, 2007 4:50:13 PM

Rank: Aficionado

Joined: 7/19/2006
Posts: 154
This is just a quick note from me, I have not read the whole thread
But the border bug is comming from GDI+ library from MS, you can google it out.

When I resize, I handle it by making the image x pixel to big and then crop it (only internal in my method). You can look at the sourcecode in http://www.sharpcms.dk/ where you can see a solution on the problem

CPalm, www.cpalm.dk
drobar
Posted: Wednesday, February 28, 2007 6:28:24 PM

Rank: Umbracoholic

Joined: 9/8/2006
Posts: 1,082
Location: KY, USA
Thanks, Christian, that was it!

ImageGen 1.5 fixes the interpolated border bug and is now available at http://www.percipientstudios.com/downloads/umbraco/ImageGen1.5.zip.

cheers,
doug.

MVP 2007/2008 - Official Umbraco Trainer for North America - Percipient Studios
thomwhaites
Posted: Wednesday, February 28, 2007 7:14:45 PM
Rank: Fanatic

Joined: 7/20/2006
Posts: 253
Location: Boston, Massachusetts
Thanks for the fix Doug! Looks great!

Tom
dduckworth
Posted: Friday, April 20, 2007 6:43:35 PM
Rank: Newbie

Joined: 4/20/2007
Posts: 5
Many thanks Doug! Just installed this and it works beautifully! :cool:
tkahn
Posted: Tuesday, April 29, 2008 6:50:56 PM

Rank: Fanatic

Joined: 11/24/2006
Posts: 259
Location: Stockholm, Sweden
neehouse wrote:
The crop functionality came up recently for me as well. For that matter, they want it to be smart, and crop the best part of the image... Anybody have any thoughts.


I don't know if this is applicable on images, but when generating thumbnails for video a strategy is to look for the (single) frame that is the largest (in Kb). The idéa is that the frame that is the hardest to compress is probably one of the more "busy" ones.

The problem with doing this in an image is that - well - you only have one "frame" to analyze. I don't know if it would work but one strategy could be to make nine different crops of a single image:

Upper - left, middle, right
Middle - left, middle, right
Lower - left, middle, right

Then you'd check to see which file was the largest, keept that and discard the rest. It's probably (but not certainly) the most "busy" part of the image.

Of course this would not guarantee good result. If you where to try this strategy on portraits for example it would be likely that a person with a big fluffy hair would se his/her hair in the middle of the picture. :-) Quite humorous, but not the desired effect.

If you wanted to take the function to the level above that you would have to incorporate some form of smart image analyzing algorithms. Cool, but you'd have to be a really good developer to pull it off and it would probably require a great deal of testing...

Web Developer at Kärnhuset - http://www.karnhuset.net - Stockholm, Sweden
drobar
Posted: Tuesday, April 29, 2008 6:58:45 PM

Rank: Umbracoholic

Joined: 9/8/2006
Posts: 1,082
Location: KY, USA
You're right, "intelligent" cropping requires a human. That's part of what's behind the new Captcha approach that shows a bunch of super-imposed images and asks the user to click in the geometric center of any of them. A human can do it easily. A computer can't. So automated cropping will always introduce some level of potentially curious results (I love that big hair example!)

However, there is often a need to crop images on a site. Especially for thumbnails. Flickr does this, for instance. The results are often surprisingly good, or at least representative enough. That's why ImageGen Professional will have a crop capability. It does work on the 3x3 grid idea that you mention, but which cell to use is left to the person using ImageGen for the cropping. Generally speaking, I suspect the "middle-center" cell will be used most often.

Here's an extract from the soon-to-be-released ImageGen Professional 2.0 reference guide about how the crop feature works.

Crop:
Crop the image to the specified Height and Width, either before or after resizing. If resize is specified, the image is first resized and any portion of the image that extends beyond the specified dimensions is cropped off, resulting in an image of the exact dimensions specified by the Height and Width parameters. This shows the maximum amount of the original image. If noresize is specified, the original, un-resized image is cropped to the dimensions specified and no resizing takes place. The portion of the original image that remains visible is based on the Align and VAlign settings.

cheers,
doug.

MVP 2007/2008 - Official Umbraco Trainer for North America - Percipient Studios
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.