Pages (2):    1 2
Member
Member
nathan   25-04-2006, 03:27
#21

I want to CROP it to the new aspect ratios, instead of simply resizing it. I don't want distorted images, but I do require them in the different (obscure) sizes, so resizing AND cropping of the image is required for my purposes.

You can see what I mean with the image sizes that I need to generate. I posted those a few comments ago.

Thanks for keeping me informed of your progress and for keeping an interest in this discussion.

Developer
Developer
trisweb   25-04-2006, 06:20
#22

The latest in SVN should do what you want.

Use the new template functions... look for them in the php file, or in the updated stopdesign theme, which is now checked into SVN (shh ;-). Also look at the comment at the top of i.php for full documentation on the URI parameters.

What you'll want is to use either ?h=768 or ?w=xxx and then crop the other dimension. In your case, fixing the height is the way to go. So like, i.php?a=album&i=image.jpg&h=768&cw=1024 will get you a 1024x768 image with the sides cropped off. You can then play with &cx=n to adjust the crop position if you can work out a way to do it for each image... (that's something I'm working on ;-)

And this is fun stuff. Probably my favorite part of this project. It allows for a lot of power and opportunity to streamline, so it's fun to program. :-) Thanks for using it.

Member
Member
nathan   25-04-2006, 08:34
#23

No, thank you for making it. I will give it a quick go tonight (now) and let you know how it all works.

I can't see why it wouldn't.

Thanks again.

Member
Member
nathan   25-04-2006, 08:51
#24

Right. This version of trunk is not the most stable of versions. Can I replace the following files in a stable release and have the functions work?:

  • i.php
  • config.php (well, its new name)
  • functions.php

I can't see why that would not work.

Developer
Developer
trisweb   25-04-2006, 10:23
#25

Not the most stable? Please, do tell... It's quite stable for me; the main problems you're seeing are probably config changes -- fill out the new zp-config.php file instead of your old config.php and it should work fine...

And no, you can't just bring in the new files; they're dependent on some of those config changes. They're good changes, so it's worth it, trust me.

Member
Member
nathan   25-04-2006, 10:32
#26

Okay. It all works. Thank you.

I do however have 1 more request (please don't hate me :-P ).
I would like to do all of this dynamically, and I was wondering if there are any, or if you can add some functions to at least get the following.

  • album name (i.e. desktops)
  • image name (i.e. image.jpg)

I was using (before all the cropping came into it all) the getSizedImageURL function, but this only supports the s value.

As I am generating all the images on the fly for every desktop picture I have, I can't (and don't want to) hard-code the image links into the template.

Can I make a final request, where I can have a function that allows me to parse all the values, or, a few little functions that will allow me to procude a link like the following:
i.php?a=&i=h=768&cw=1024

I am generating the same sized images all the time, so I would place that link, or something like it in the/a template file. That way, with every image, I have the selection/links to download the other x (in my case 3) image sizes.

I hope that made sense. And I am sorry to do this to you once again.

Member
Member
nathan   25-04-2006, 10:34
#27

Quote:Not the most stable? Please, do tell... It's quite stable for me; the main problems you're seeing are probably config changes -- fill out the new zp-config.php file instead of your old config.php and it should work fine...

And no, you can't just bring in the new files; they're dependent on some of those config changes. They're good changes, so it's worth it, trust me.
The problems are not for this thread. I will open up another one. It is basically what you described, especially with the setup of app.

Sorry for the double post (again). I only just got it.

Developer
Developer
trisweb   25-04-2006, 10:39
#28

Right, so just use the image loop, like in any of the themes (use one as an example) and for each image, print out its link using the getCustomImageURL(...) function. That part's easy, and I thought you knew that already ;-) Just look at the themes, all the loops are set up. You don't need to "get" the album or image names, hehe

Your getCustomImageURL would look something like...

getCustomImageURL(null, null, 768, 1024)

The first two are $size and $width, which you don't want, so keep them null. This would go in the image loop, and would produce links to those sized images for each image in the album.

Hope this helps! I really should put up some better documentation so this stuff makes more sense...

Member
Member
nathan   25-04-2006, 10:59
#29

Ah. I see. I did NOT update to the latest SVN. I managed to get it working on the other build. My fault. Sorry to bother you with that. I did not see that function there.

All working now.

Developer
Developer
trisweb   25-04-2006, 20:18
#30

Excellent. Can I see what you're doing with it? I'm imagining some kind of wallpaper site...

Member
Member
nathan   25-04-2006, 23:09
#31

For sure you can see. It is local for the time being, but as soon as it goes live, I'll put a link up here.

Member
Member
3stripe   25-04-2006, 23:27
#32

Ahhh wallpaper autosizing, nice idea! (About to post some wallpaper to a site actually)

Member
Member
detayls   02-05-2006, 17:55
#33

OK. This is all waaaay too confusing for my poor little brain and I see no way to add a new topic.

Please could someone summarize the changes and point me to a set of instructions?

My site is functioning quite well with the K2 theme and WordPress integration called ZenPress at www.detayls.com.

The two issues that I have are cropped thumbnails and strange asapect ratios of the normal image.

Since I have uploaded mostly 640x480 JPGs and specified a thumbnail size of 120 x 90 (as far as I recall), I was expecting to see the images simply resized as thumbnails. Instead they are cropped from the center.

When viewing portrait images the K2 theme appears to be forcing a "squeeze" on the image and they are showing at closer to square aspect ratios. How do I avoid this?

Thanks.

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