Pages (2): 1 2   
Member
Member
nathan   14-04-2006, 09:52
#1

I posted a thread about having zenphoto generate multiple and varying image sizes, and I can see that this only used the width value. Is there a way to have a height value specified also, so that the new generated size is cropped as well?

Thanks for you help.

Developer
Developer
trisweb   15-04-2006, 05:55
#2

Not possible yet... hopefully I'll add that feature soon. If you really want it, you could add a couple more parameters and do the image manips if you know how...

Member
Member
nathan   15-04-2006, 08:10
#3

Damn. I don't actually know how. Can you show me or is that too much to ask?

Developer
Developer
trisweb   15-04-2006, 19:42
#4

Yeah, if I did that I might as well implement it.

I might just do that before the next version, so hold your horses ;-)

Member
Member
nathan   15-04-2006, 22:59
#5

Thankyou. I really appreciate it. I think it would be a wonderful feature. I'm looking forward to it. (no pressure though)

Member
Member
nathan   19-04-2006, 10:09
#6

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.

Member
Member
3stripe   19-04-2006, 10:47
#7

This is another function I'd be very grateful for as well - sounds perfect for something I've been trying to do myself for ages.

Developer
Developer
trisweb   20-04-2006, 00:34
#8

Hahaha, so there [i]is[/i] pressure ;-)

Alright, I think I can do it right now. Not going to release though. I'll post a link to the latest in SVN once I'm done.

Developer
Developer
trisweb   20-04-2006, 01:04
#9

If you come back...

Do you need the capability to specify the position of the crop? Eg: resize image to 800x600, then take a 400x400 crop from (x,y) position (150, 100) ?

If not, I'll assume center.

Member
Member
nathan   20-04-2006, 02:22
#10

--
If you come back...


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]

Developer
Developer
trisweb   20-04-2006, 06:18
#11

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? ;-)

Developer
Developer
trisweb   20-04-2006, 10:28
#12

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:

  • i.php
  • config.php.example (just for line 58)
  • functions.php

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

Member
Member
nathan   20-04-2006, 11:10
#13

Wow. I can't say I was expecting it so quickly. Well done.
So, it won't work with mod_rewrite? I don't mind. Not yet anyway.

I will give it a go and see how it handles. Thanks so much for this.

Member
Member
nathan   20-04-2006, 12:42
#14

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:

  • I wish for zenphoto to generate 3 different sized images AS WELL as the thumbnail and scaled/ cropped version in the preview.
  • I input an insanely large format image into zenphoto. It generatd both preview and thumb correctly.
  • Using the above code, how do now generate the following image sizes?:

[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]

Developer
Developer
trisweb   20-04-2006, 20:21
#15

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.

Member
Member
aitf311   20-04-2006, 20:33
#16

Woah, thats kinda cool. Watch out flickr! Works like a charm

Member
Member
nathan   21-04-2006, 01:24
#17

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.

Member
Member
3stripe   24-04-2006, 10:34
#18

Hey folks, been away else woulda commented earlier - BIG THANK YOU for adding this so fast, look forward to test it out. Cheers

Member
Member
nathan   24-04-2006, 11:15
#19

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.

Developer
Developer
trisweb   24-04-2006, 17:29
#20

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...

Pages (2): 1 2   
  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.