Ok looks like imageGen is the package i'm after, spent some time with
cropper and resize. Once installed i don’t see how i can use this tool, do
i create a datatype? The manual does not seem to explain what to do step by
step..is there anything out there?
I want my end user to upload a file and have them resized automatically and
a thumbnail created, all to my specification etc.
ImageGen isn't like the croppers in that it isn't a datatype. It's a server application that will process your images to your specs on the way out to the website visitor. It doesn't alter the uploaded image at all, which is handy if you ever need a bigger version than the thumbs you created initially.
I suspect you're trying to do something more 'tricky' than you need to.
The first step is to create your templates and macros for your site and get the uploaded image(s) to display at their original fullsize. Once you're happy with that you would update your templates and macros to have ImageGen resize those original images to your specifications.
For instance, if you wanted to make a flickr-style photo gallery you'd have a macro that displayed all the images in some sort of grid to the website visitor and you'd end up with a lot of <img> tags like this:
<img src="/media/1234/photo1.jpg" /> <img src="/media/2233/photo2.jpg" /> etc.
You would update the macro for the photo gallery to process the images with ImageGen, to get 100px images, for instance:
thanks Doug, that does makes things clearer and i now have it working albeit in a very simple way. So based on what your saying my client could still upload a massive image (bytes and dimensions) which i dont think is a a good idea...should i be using an image resizer in conjunction with your tool?
Personally, I don't care if they upload big images. In fact, I encourage it. Server space is cheap compared to trying to find the original image and upload a larger version later when (inevitably) the client or designer wants to use bigger versions or make a very large photo available as a download link in addition to showing a thumbnail and a larger 'lightbox' size for screen.
ImageGen resizes the original image on the fly, saving the result to a cached file for instant recall the next time it is requested.
I don't know of any tool that intercepts an upload, resizes, and saves only the resized version but I may be mistaken about that. If you find one please let me know.
I mean the built in Image Cropper which is part of Umbraco 4.5+.
The random images could be done in a couple of ways.
1 You could add the Image Cropper datatype to your Image media type with the correct size and use the Create Crops package to make sure all you media items have a crop available. Than use that crop on the home page.
2 Create a custom media type which has the all the same properties as the Image media type, but with the extra Image Cropper datatype. Than make sure only images of this custom media type are shown on the home page.
3 Use ImageGen to make crops of the images which are shown on home page.
If you use option 1 or 2 it's probably a good idea to install Digibiz Advanced Media Picker 2.0 Release Candidate. Even if you don't want to use the datatype it adds an extra event which makes sure all the new media will always have the crop available.
thanks for the info but lets say i have following situations...target image size is 500px wide by 300px height
Client uploads a huge image (1200 px by 800 px) they need to upload, view then reszie to my target size - where does the image cropper tool save the cropped version? in the media folder then the user can just pick them?
Client uploads a small image (400px by 250px) can i enforce a miniumum size when a client is uploading an image?
The image cropper stores the cropped version in the same folder the original image and thumbnail are. Have a look at this video to see how it works: http://www.screenr.com/0zUs.
I don't think you can enforce a minimum size, however if the crop is bigger than the image it will scall the image. This will make the image blurry, but in the correct size.
How do i get started?
Ok looks like imageGen is the package i'm after, spent some time with cropper and resize. Once installed i don’t see how i can use this tool, do i create a datatype? The manual does not seem to explain what to do step by step..is there anything out there?
I want my end user to upload a file and have them resized automatically and a thumbnail created, all to my specification etc.
ImageGen isn't like the croppers in that it isn't a datatype. It's a server application that will process your images to your specs on the way out to the website visitor. It doesn't alter the uploaded image at all, which is handy if you ever need a bigger version than the thumbs you created initially.
I suspect you're trying to do something more 'tricky' than you need to.
The first step is to create your templates and macros for your site and get the uploaded image(s) to display at their original fullsize. Once you're happy with that you would update your templates and macros to have ImageGen resize those original images to your specifications.
For instance, if you wanted to make a flickr-style photo gallery you'd have a macro that displayed all the images in some sort of grid to the website visitor and you'd end up with a lot of <img> tags like this:
<img src="/media/1234/photo1.jpg" /> <img src="/media/2233/photo2.jpg" /> etc.
You would update the macro for the photo gallery to process the images with ImageGen, to get 100px images, for instance:
<img src="/imagegen.ashx?image=/media/1234/photo1.jpg&width=100&height=100&constrain=true" /> <img src="/imagegen.ashx?image=/media/2233/photo2.jpg&width=100&height=100&constrain=true" />
doug.
thanks Doug, that does makes things clearer and i now have it working albeit in a very simple way. So based on what your saying my client could still upload a massive image (bytes and dimensions) which i dont think is a a good idea...should i be using an image resizer in conjunction with your tool?
Stephen
Personally, I don't care if they upload big images. In fact, I encourage it. Server space is cheap compared to trying to find the original image and upload a larger version later when (inevitably) the client or designer wants to use bigger versions or make a very large photo available as a download link in addition to showing a thumbnail and a larger 'lightbox' size for screen.
ImageGen resizes the original image on the fly, saving the result to a cached file for instant recall the next time it is requested.
I don't know of any tool that intercepts an upload, resizes, and saves only the resized version but I may be mistaken about that. If you find one please let me know.
cheers,
doug.
thanks Doug, getting my head round it now..just a different way of thinking for me. Great package.
You could also add a crop datatype to you media types. That way all you media can be cropped and you have full control over it.
If you add the crop datatype all your current media won't have the crops. You can use this package to solve that: Create Crops.
Also if you install the Digibiz Advanced Media Picker 2.0 Release Candidate you can make sure all the new media you upload will have the correct crops.
That's how I also combine images and cropping.
Jeroen
thanks Jeroen, when you saya crop datatype, is this built into Umbraco or do you mean Image Cropper package?
I have a requirement whereby i have random images on my home and to fit in with the design they need to be an exact size, would your solution do this?
I had thought that i would just need the client to edit them using an offline tool...
Regards,
Stephen
I mean the built in Image Cropper which is part of Umbraco 4.5+.
The random images could be done in a couple of ways.
1 You could add the Image Cropper datatype to your Image media type with the correct size and use the Create Crops package to make sure all you media items have a crop available. Than use that crop on the home page.
2 Create a custom media type which has the all the same properties as the Image media type, but with the extra Image Cropper datatype. Than make sure only images of this custom media type are shown on the home page.
3 Use ImageGen to make crops of the images which are shown on home page.
If you use option 1 or 2 it's probably a good idea to install Digibiz Advanced Media Picker 2.0 Release Candidate. Even if you don't want to use the datatype it adds an extra event which makes sure all the new media will always have the crop available.
Jeroen
thanks for the info but lets say i have following situations...target image size is 500px wide by 300px height
Cheers,
Stephen
The image cropper stores the cropped version in the same folder the original image and thumbnail are. Have a look at this video to see how it works: http://www.screenr.com/0zUs.
I don't think you can enforce a minimum size, however if the crop is bigger than the image it will scall the image. This will make the image blurry, but in the correct size.
Jeroen
is working on a reply...