Direct Image Linking

doomdead

Joined: 2003-04-06
Posts: 174
Posted: Thu, 2005-01-06 17:14

In G1, you can right click on a picture, grab the url of the picture itself, and give that direct link to just the image to someone. I havn't had a chance to test this with G2. I am under the impression, if hte G2data directory is stored outside the website this wont be possible. (which can be a good thing for some people). However, can I still set it up so that the pictures can be directly accessed provided the url is correct?

----

Gallery URL (optional):
Gallery version:
Webserver (with version):
Datatabase (with version):
PHP version (eg 4.2.1):
phpinfo URL (optional):
Graphics Toolkit(s):
Operating system:
Web browser/version:

 
jmullan
jmullan's picture

Joined: 2002-07-28
Posts: 974
Posted: Thu, 2005-01-06 19:36

This will still work in G2, unless you have specified permissions that prevent an anonymous user from viewing the picture. We haven't set up any hotlink prevention schemes yet, so if the permissions that you set in G2 allow anonymous users to view an item, anyone will be able to hotlink to that item.

 
doomdead

Joined: 2003-04-06
Posts: 174
Posted: Thu, 2005-01-06 21:39

When you right click on the photo you dont get the direct url, you get the php page for that photo. How am I going to get the direct link in G2? Do I have to use the G2 database and read it that way or is there another way im not seeing?

I need the ability to have the direct path to the image. Even after permissions are set to read the albums folder.

 
fryfrog

Joined: 2002-10-30
Posts: 3236
Posted: Fri, 2005-01-07 00:37

Use that php file as the link, it will work.

Example Code:

[img]http://fryfrog.com/gallery2/main.php/d/1021-2/abp.jpg[/img]

Example in Action:
[img]http://fryfrog.com/gallery2/main.php/d/1021-2/abp.jpg[/img]

 
Butrflied

Joined: 2005-06-10
Posts: 3
Posted: Fri, 2005-06-10 00:23

When I try to get a direct link to hotlink an image to post into a forum .. I get something like this

but some vBulletin boards wont reconize that in img tag

how can I translate the url so that it includes ".jpg" so that the other forum languages will reconize it?

The path to my image on the server is:
/g2images/places/2005-04-PointVicente/CIMG2318.jpg

My Gallery

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Fri, 2005-06-10 03:59

You can enable URL rewritting and get URLs like this:

http://photos.kevinnehls.com/v/Trips/OlympicNP/PortTownsend/IMG_1058.jpg.html

You can then just chop off the .html and still get to the image:
http://photos.kevinnehls.com/v/Trips/OlympicNP/PortTownsend/IMG_1058.jpg

However, I'm not sure how you'd get to the full size image here:
http://photos.kevinnehls.com/v/Trips/OlympicNP/PortTownsend/IMG_1058.jpg.html?g2_imageViewsIndex=1

 
pelle
pelle's picture

Joined: 2004-12-10
Posts: 389
Posted: Fri, 2005-06-10 09:45
jmullan wrote:
We haven't set up any hotlink prevention schemes yet

Yes, we do - but only for people with mod_rewrite (URL Rewrite module) though. You may also chose to watermark hotlinked images if you activate the Watermark module.

Download URLs looks like this with the URL Rewrite module:
http://photos.kevinnehls.com/d/31-3/IMG_1058.jpg

 
Butrflied

Joined: 2005-06-10
Posts: 3
Posted: Fri, 2005-06-10 18:12

Thanks guys .. took me a while to find the mod_rewrite module .. but that did the trick :)

 
bigserpent

Joined: 2005-02-04
Posts: 14
Posted: Fri, 2005-06-10 18:19

hi,

I have configured the url_rewirte and it working well. I have a question on premission of the .htaccess file. I have set the premission to "666", is it correct?

thanks,

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Sat, 2005-06-11 01:39

666 on a file is still "world" writeable. Set it to 644 so only you can change it. When you want to make changes to your URL rewrite setup, set it to 666 first, make your changes, then set it back to 644.

The same for your config.php. It should be set to 644 and only changed to 666 when Gallery needs to write to it.

 
ZED28

Joined: 2005-05-22
Posts: 22
Posted: Thu, 2005-07-28 03:30

I'm still battling this. I've got mod wre-write working and right clicking a photo gives me this URL which vBulletin coughs at.

http//www.gmlsxs.org/d/4360-2/DSCN1579.jpg?g2_GALLERYSID=b43246fef5f6b4b9d64cfff638c4e698

Now if I trim off the stuff at the end, my link will work. How can I generate the cleaner URL for the images without having to tell all of my users how to modify the URL when they need to post an image in our forums?

http//www.gmlsxs.org/d/4360-2/DSCN1579.jpg

Thanks!

 
doomdead

Joined: 2003-04-06
Posts: 174
Posted: Thu, 2005-07-28 04:23

what about for IIS

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Thu, 2005-07-28 05:45

ZED28, search the G2 forums. This has been discussed many times. Here is one such possible fix: http://gallery.menalto.com/index.php?name=PNphpBB2&file=viewtopic&t=27985&highlight=quick+url

doomdead, other than IIS totally sucking for what it tries to do, I'm not sure what your question is. ;) What about IIS?

 
doomdead

Joined: 2003-04-06
Posts: 174
Posted: Thu, 2005-07-28 14:42

Hey now, I've dipped my tow on the darkside, isnt my taste... My 03 server with IIS is very stable and does quite a bit for me.....

Can we set up mod_rewrite somehow on IIS. I would love to have shorter urls with gallery and the ability to link directly to the image.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Fri, 2005-07-29 01:52

I was only razing you ;)

I think you're referring to URL Rewrite of G2. mod_rewrite is an Apache module, getting that to run on IIS probably isn't possible. ;)

I was only able to find a few topics refering to url rewrite iis when searching. Maybe search the G2 forums and read over those threads. Though from the brief glance I took of them it doesn't appear like anyone came to any grand conclusion on how to use IIS's ISAPI rewrite for this.

 
ZED28

Joined: 2005-05-22
Posts: 22
Posted: Fri, 2005-07-29 02:05
nivekiam wrote:
ZED28, search the G2 forums. This has been discussed many times. Here is one such possible fix: http://gallery.menalto.com/index.php?name=PNphpBB2&file=viewtopic&t=27985&highlight=quick+url

doomdead, other than IIS totally sucking for what it tries to do, I'm not sure what your question is. ;) What about IIS?

Thanks for the insight nivekiamm checking it out now! :)