Can I just check the progress of this? I do/ did not expect this to be done at the drop of a hat, but I was wondering if it will be done and if a possible timeframe could be given.
I don't mean to be rude, I am just being direct. I need to have this functionality for a project and I would like to know if I should 'try' and do it myself, have someone else do it, or hold my horses a little longer.
Thanks for your time.
There is no question that I will be back. I love this application and will continue using it for a long time yet. I just need/ed this done and was going to go elsewhere to have this feature implemented. Nothing at the moment could drag me away from this app.
Back to the question. It would be nice to be able to specify the crop region, if that is possible.
Can you tell me when it is avaible in SVN if you do it.
I hope you did not take it the wrong way. I really appreciate the work you do on this and am very thankfull to have such a wonderfull application at my displosal.
Thanks again.
[b]EDIT: I saw that you would post a link when you were done. Sorry. I did not read that part.[/b]
Nathan, don't worry about it, I have been wanting to do this for a long time.
It's very easy to allow specification of the crop region, so I'll add that.
Seriously, I'm not taking it the wrong way I understand and I'm happy to help. Why else would I be doing this? ;-)
It's in SVN, but it's not quite usable yet. Browse it here:
http://svn.berlios.de/svnroot/repos/zenphoto/trunk/
The files you need to update are:
There may be problems because of other changes, in which case you should just grab the whole thing. It's pretty stable at the moment.
Right now, the options are only available to the URL, not through mod_rewrite fancy paths, but here's an example of the parameters:
i.php?a=[i]albumname[/i]&i=[i]image.jpg[/i]&s=640
&cw=400&ch=300&cx=200&cy=100
s = size (of the longest side of the image if conf['image_use_longest_side'] is true, otherwise it's the exact width. Sorry, I'll try to add specific height later)
cw = crop width
ch = crop height
cx = crop offset x (from top-left)
cy = crop offset y
Okay. I gave it a whirl, but I am having a few trobules with it. I think it is just because I am not doing it correctly, not that there is a problem with your code/method, as your example works perfectly.
Oh, I am using the latest SVN from trunk by the way, so I updated ALL the files.
My problem:
[list]
[]1024x768
[]1600x1200
[*]1680x1050
[/list]
An example of how to generate one of these images would be appreciated, if they are all the same.
Again, thanks for this.
[b]EDIT: The original photo/image zenphoto has is actually the largest sized image (1680x1050) in this case. Thought you might need to know.[/b]
Weeeeel, since the 1680x1050 image has a very weird aspect ratio, you actually won't be able to get a 1600x1200 crop from it without upsampling (making the image larger). Zenphoto won't do this as it degrades the quality of the image considerably.
You can make any size less than 1680x1050 though.
`i.php?a=albumname&i=image.jpg&s=1228
&cw=1024&ch=768`
I had to calculate that 1228 width by hand... so I see why you need to be able to specify height. Otherwise it's just a matter of making it wide enough so it's high enough to get the crop you want. The final image size is going to be cropped from this aspect ratio original, so use cw and ch to specify the crop. You can also fine-tune the position with cx and cy.
Bottom line though, if you want it to resize up to 1600x1200, I won't put that in the official release. You have to remove a few lines in i.php... just comment out the if statement after this comment:
// If the requested image is the same size or smaller than the original, redirect to it. and that'll let you make images bigger than the original. Be warned though, you're losing quality...
I'll add the ability to specify height or width directly soon, until then calculate the s value needed from trial and error or the aspect ratio.
[b]Edit:[/b] It's also important to see that you don't need to generate [i]image files[/i] beforehand at all. The image doesn't have to be generated to be viewed, and it's all done on the fly, so using this i.php?... stuff is exactly the same as using a real image's URL. You can just throw around that URL like an image; put it in tags and everything.
So I hope you're not confusing the image generation with other programs' methods... it's a lot slicker than that.
They are [i]weird[/i] aspect ratios as they are widescreen images. For the moment, I would like to keep this ratio as that is what the larger/ wide screens demand.
I could always give zenphoto a larger image if necessary. All the images are illustrator vector files, so they can be any size really.
I'll comment out the line and see what happens, but I think I might hold off for the specific height. I don't really want to loose quality.
Oh, and I know that all those images are generated on the fly. It is a wonderful system and now I don't (well, there are still a few issues to sort out first) all the different file sizes on the server. It can make them for me.
3stripe, it works really well, but, in my instance, I am having a little trouble with it. I have weird ratios that need to set a specific height with my width.
trisweb, is it difficult to have zenphoto generate images based on a width AND a height? I mean, is it a lot of work, or something that can be implemented in a night or so.
Nope, I'm definitely going to take care of that soon.
The problem is a matter of cropping or resizing out-of-proportion... so you're saying you'd like to resize it and crop it down? Or just specify a width and height and resize to that, losing the aspect ratio (distorting the image)? I think I'll make both available anyway, but I'd like to know what you're trying to do...