User not logged in - login - register
Home Calendar Books School Tool Photo Gallery Message Boards Users Statistics Advertise Site Info
go to bottom | |
 Message Boards » » Best Flickr API kits? Page [1]  
kiljadn
All American
44689 Posts
user info
edit post

I've seen some implementations out there - phpFlickr comes to mind - do you guys have a preferred one that you use?

6/11/2009 11:15:30 AM

kiljadn
All American
44689 Posts
user info
edit post

6 hours in tech talk without an answer is the TWW equivalent of a glassy-eyed blank stare


thx guys

6/11/2009 5:39:40 PM

Fail Boat
Suspended
3567 Posts
user info
edit post

If you would have asked about picasa, I could have helped there.

6/11/2009 6:41:37 PM

kiljadn
All American
44689 Posts
user info
edit post

bttt...

anyone?

6/16/2009 5:26:16 PM

agentlion
All American
13936 Posts
user info
edit post

what are you trying to do with it? just start from scratch to integrate Flickr pictures/albums into your own site?

6/16/2009 5:42:03 PM

kiljadn
All American
44689 Posts
user info
edit post

well i got the "just integrate" part down


I'm actually looking to extend it a bit by adding random image displays and other such - really i wanted to know if phpflickr had been used by anyone, and if there is an easier method of using the API out there

6/16/2009 6:36:04 PM

kiljadn
All American
44689 Posts
user info
edit post

k so i need some help here.


I have phpflickr working, and it will pull the images I want that are tagged appropriately, but I need to scale certain images so that they will fit in a ajax lightbox that I've built.


Basically an "if image height is greater than 500px, scale image by 75%"

I have seen plenty of scripts that will scale images - jQuery and PHP - but none of them seem to work on these images that I am pulling dynamically from Flickr.

I would prefer to do the scaling using PHP, but honestly I'm pretty much a PHP n00b and have no idea where to begin.

Here's the phpflickr code I'm using to pull the images, for reference

$flickrtag is a value pulled from a field in the DB, it varies per query

		<?php require_once("phpflickr/phpFlickr.php");
// Create new phpFlickr object
$f = new phpFlickr("My API key", "My API Secret");
$f->setToken("My Token");
$f->enableCache("db","mysql://redacted for obvious reasons");

$person = $f->people_findByUsername("User Name I'm searching under");
// Search for photos tagged by client
$photos_client = $f->photos_search(array("user_id"=>$person['id'], "tags"=>$flickrTag, "per_page"=>100));
foreach ((array)$photos_client['photo'] as $photo) {
// Build image and link tags for each photo
echo "<li>";
echo "<img border='0' title='$photo[title]' alt='$photo[title]' ".
"src=" . $f->buildPhotoURL($photo, "Medium") . ">";
echo "</li>";
}
echo "\n";
?>


I guess I need to write an if/else statement in there that will scale the image if taller than 500, but leaves it alone if not.

Halp plx?

8/2/2009 12:39:06 PM

Noen
All American
31346 Posts
user info
edit post

do you want to *actually* resize the image to 500px, or just insert a "height='500'" attribute on the image to scale it in the browser?

http://us2.php.net/function.getimagesize should get you the information you need

the imageinfo array it returns is what you'd use for the conditional:

if(imageinfo[0] > 500 || imageinfo[1] > 500) {
//then do something. [0] is width, [1] is height
} else {
//do the normal thing
}

8/2/2009 1:02:14 PM

kiljadn
All American
44689 Posts
user info
edit post

I think just scaling it in the browser would be fine. I don't want to get the image at one size and then re-render it at a different size. (unless that is the better way?)


I'll give this a shot.

[Edited on August 2, 2009 at 1:04 PM. Reason : .]

[Edited on August 2, 2009 at 1:04 PM. Reason : not sure]

8/2/2009 1:03:53 PM

 Message Boards » Tech Talk » Best Flickr API kits? Page [1]  
go to top | |
Admin Options : move topic | lock topic

© 2024 by The Wolf Web - All Rights Reserved.
The material located at this site is not endorsed, sponsored or provided by or on behalf of North Carolina State University.
Powered by CrazyWeb v2.38 - our disclaimer.