Minimum resolution - Force enlarge, API IDs

kakmael

Joined: 2011-09-01
Posts: 12
Posted: Thu, 2011-09-29 15:27

Hello everybody!
I got a little problem with my generated thumbnails.

I am using the API to get the ID by Path method (php method: GalleryCoreApi::fetchItemIdByPath(xyz.jpg") ).
Once I got the ID of the picture, I juste call the picture with my gallery server path (which looks like: www.myserver.com/gallery2/main.php?g2_view=core.DownloadItem&g2_itemId=xyzID).
Already here, I don't know if I'm taking a good path to do that.. Anyways, it works.
But now, I want to have 5 sizes of thumbnails (the biggest one is 500x500 criteria). So the picture IDs are incremental, for example:
- original picture ID = 450
- then the first thumbnail ID would be = 451
- the second 452
- third 453
- fourth 454
- fifth 455
- the next ID (456) wouldn't be the same picture as requested, because it generated 5 thumbnails. But that is okey.

But now, if I add a new image, which size is lesser than 500 pixels, the thumbnail will not be generated. So, the *rule* with incrementing ID's to get the next thumbnail size won't work; because the picture will change (thumbnail not generated, because original picture to small).

So there would be several solutions:
- forcing to enlarge the picture, that it has minimum 500x500 pixels
- forcing to create thumbnails, even if it doesn't have the good size
- method from api which tells me if a pictureID is the same picture as another pictureID
- method from api which gives me all IDs of a picture
- ...

or maybe I'm totally wrong, but it would be very helpfull if someone knows something about that :)

Thank you very much,
Kakmael

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Thu, 2011-09-29 20:14

I'd use mediaBlock w/ g2_maxImageWidth and g2_maxImageHeight parameters.

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
kakmael

Joined: 2011-09-01
Posts: 12
Posted: Fri, 2011-09-30 07:46

Hey! Thank you for the fast reply! I tried it, and it looks like something I could use :)

I tested the parameters, and now I've got a few questions. I used "@readfile("http://localhost:8080/PhotoGalleries/gallery2/mediaBlock.php?g2_itemId=349&g2_maxImageHeight=50&g2_maxImageWidth=50");"

- I observed that the minimum value of the sizes is 100 (is it possible to go under 100?) and the maximum is 500 (after that it shows the original file).
- I would like to have NO link on the image (when i click on the picture, it redirects me to the gallery album). Is it possible to avoid that?
- Is it possible to remove the border (the shadows) on the picture? I need a clean picture

Sorry if those questions are newby ones! :)

Thank you,
Kakmael

 
kakmael

Joined: 2011-09-01
Posts: 12
Posted: Fri, 2011-09-30 08:31

OH.. okey... I took a break, and now I just found the 2 options for the shadow and the link... *hum hum* (&noLink=1&noShadow=1), sorry.

There is still the question about the minimum size that is fixed to 100 :) but anyways, I'll use that library

Thanks!
Kakmael

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Fri, 2011-09-30 10:38

mediaBlock finds the closest match to the size parameters you specify.
But you can also further tweak the size with &useMicro=value where the value is the largest size being displayed. This currently only works with thumbs but could easily be extended to work with resizes.

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
kakmael

Joined: 2011-09-01
Posts: 12
Posted: Fri, 2011-09-30 11:15

Aaahh okay! So it still uses the thumbnail sizes, didn't got that. So that's perfect!
Last more thing (after that I won't annoy you anymore)

The "return" value automatically comes in a table. I have several different picture request (in a foreach), so the page shows a lot of tables. Is it possible to get ride of it? Didn't find any options (and I looked twice this time).
Or do I have to use css to hide it? (My knowledge is very limited in css, I don't even know if that's possible.. and it's better to have a clean code :) )

Thanks a lot!
Kakmael

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Fri, 2011-09-30 12:06

it only presents thumbs if useThumb=1 is set, but the thumbs are considered in the maxImage size query - all sizes are.
Each image is surrounded by an imageframe table for drop shadow or other frame.
For one client I created a CSS3 version using box-shadow which does not use the table, but the shadow does not display properly in IE < 9

I could make this version available this weekend.

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
kakmael

Joined: 2011-09-01
Posts: 12
Posted: Fri, 2011-09-30 13:05

Mmhh, the thing is that at the end I only need one picture at time, without any styles or tables.. really only the picture. (or the ID of the picture/thumb).
But at least, I think I'll remove the table with javascript after each page is loaded. It's a workaround, but I hope it'll do it.

I don't want to make you work more for me! :D

Again, thank you for your assistance.
Kakmael