location of images

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

location of images

aretai aretai
Hi,

Just a small problem. I'm trying to create a script that'll export the wiki
pages (sth similar to Special:Export), there is one problem because of the
images. When using Special:Export we get a content with a

[[Image:imagefile.imageextension]]

I'd like to have a link to an image located on my host instead. All images
are stored in the images directory within wiki. Below are some
subdirectories: d, f, etc.

Is there any rule where is given image placed while being uploaded?

Regards,
Aretai
_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: location of images

Dorożyński Janusz (4-webd)
| -----Original Message-----
| From: ... aretai aretai
| Sent: Tuesday, March 06, 2007 5:29 PM
/
| I'd like to have a link to an image located on my host
| instead. All images are stored in the images directory within
| wiki. Below are some
| subdirectories: d, f, etc.
|
| Is there any rule where is given image placed while being uploaded?

http://www.mediawiki.org/wiki/Manual:MediaWiki_file_usage helps you, I hope.

        Reg, Janusz "Ency" Dorozynski


_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: location of images

Platonides
In reply to this post by aretai aretai
aretai aretai wrote:

> Hi,
>
> Just a small problem. I'm trying to create a script that'll export the wiki
> pages (sth similar to Special:Export), there is one problem because of the
> images. When using Special:Export we get a content with a
>
> [[Image:imagefile.imageextension]]
>
> I'd like to have a link to an image located on my host instead. All images
> are stored in the images directory within wiki. Below are some
> subdirectories: d, f, etc.
>
> Is there any rule where is given image placed while being uploaded?

There is for now (that can change), Special:Filepath will continue working.


_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: location of images

aretai aretai
In reply to this post by aretai aretai
thx for answers

I've checked it, but there is only some general info. What I need is to know
the exact location of a file when it gets uploaded.

Regards
Aretai


On 3/6/07, Dorozynski Janusz <[hidden email]> wrote:

>
> | -----Original Message-----
> | From: ... aretai aretai
> | Sent: Tuesday, March 06, 2007 5:29 PM
> /
> | I'd like to have a link to an image located on my host
> | instead. All images are stored in the images directory within
> | wiki. Below are some
> | subdirectories: d, f, etc.
> |
> | Is there any rule where is given image placed while being uploaded?
>
> http://www.mediawiki.org/wiki/Manual:MediaWiki_file_usage helps you, I
> hope.
>
>        Reg, Janusz "Ency" Dorozynski
>
>
> _______________________________________________
> MediaWiki-l mailing list
> [hidden email]
> http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>
_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: location of images

Rob Church
On 07/03/07, aretai aretai <[hidden email]> wrote:
> I've checked it, but there is only some general info. What I need is to know
> the exact location of a file when it gets uploaded.

In the default configuration, when $wgHashedUploadDirectory is
switched on, the filename is hashed (MD5), and the first part of the
hash is exploded, e.g. "83aff429..." becomes /8/83/<full filename>.
This is appended to the upload directory and is used to store the file
proper.

The code which handles this can be found in includes/Image.php and
includes/ImageFunctions.php, e.g. wfGetHashPath() etc.


Rob Church

_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: location of images

aretai aretai
Hi,

thx for answers.

Is it possible to make wiki store all the images in the same folder or will
it cause any problems? In case there is an existing wiki and images were
stored in a way you've described is there a way to migrate them to a single
folder (and make wiki to point to a new location) without disrupting the
wiki service?

Regards,
Aretai


On 3/7/07, Rob Church <[hidden email]> wrote:

>
> On 07/03/07, aretai aretai <[hidden email]> wrote:
> > I've checked it, but there is only some general info. What I need is to
> know
> > the exact location of a file when it gets uploaded.
>
> In the default configuration, when $wgHashedUploadDirectory is
> switched on, the filename is hashed (MD5), and the first part of the
> hash is exploded, e.g. "83aff429..." becomes /8/83/<full filename>.
> This is appended to the upload directory and is used to store the file
> proper.
>
> The code which handles this can be found in includes/Image.php and
> includes/ImageFunctions.php, e.g. wfGetHashPath() etc.
>
>
> Rob Church
>
> _______________________________________________
> MediaWiki-l mailing list
> [hidden email]
> http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>
_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: location of images

Platonides
You can store all the images on the same folder by setting
$wgHashedUploadDirectory=false;
The wiki can handle it without problems, splitting on folders is done
because some filesystems have problems (are slower) when a folder has
lots of files.


_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: location of images

Fernando Correia
2007/3/7, Platonides <[hidden email]>:
> The wiki can handle it without problems, splitting on folders is done
> because some filesystems have problems (are slower) when a folder has
> lots of files.

Aretai, mind this warning. It can be *extremely slow* if you have a
large number of files (several thousands, or close to a million).

I suggest you estimate how many images your wiki may accumulate for
some time, say a few years, and try to create that many files on your
filesystem using an automated script. Then test access time to these
files.

Anyway, are you sure you need them in just one directory?

_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: location of images

Rob Church
On 07/03/07, Fernando Correia <[hidden email]> wrote:

> 2007/3/7, Platonides <[hidden email]>:
> > The wiki can handle it without problems, splitting on folders is done
> > because some filesystems have problems (are slower) when a folder has
> > lots of files.
>
> Aretai, mind this warning. It can be *extremely slow* if you have a
> large number of files (several thousands, or close to a million).
>
> I suggest you estimate how many images your wiki may accumulate for
> some time, say a few years, and try to create that many files on your
> filesystem using an automated script. Then test access time to these
> files.
>
> Anyway, are you sure you need them in just one directory?

Oh, and just to add - if the whole reason for asking is due to
concerns over migration or mass-imports, then there are maintenance
scripts (maintenance/importImages.php, maintenance/rebuildImages.php)
that can help.


Rob Church

_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: location of images

aretai aretai
In reply to this post by Fernando Correia
I'd prefer to keep it as it is..., but well this makes a coding (i.e.
linking to this images from external application) a little bit tricker.
Coding will be probably performed by non-MW programmer so want to make his
task a little bit easier.

But yes performance issues are v.imp so probably it will be necessary to
keep the directory structure.

Regards,
Aretai


On 3/7/07, Fernando Correia <[hidden email]> wrote:

>
> 2007/3/7, Platonides <[hidden email]>:
> > The wiki can handle it without problems, splitting on folders is done
> > because some filesystems have problems (are slower) when a folder has
> > lots of files.
>
> Aretai, mind this warning. It can be *extremely slow* if you have a
> large number of files (several thousands, or close to a million).
>
> I suggest you estimate how many images your wiki may accumulate for
> some time, say a few years, and try to create that many files on your
> filesystem using an automated script. Then test access time to these
> files.
>
> Anyway, are you sure you need them in just one directory?
>
> _______________________________________________
> MediaWiki-l mailing list
> [hidden email]
> http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>
_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: location of images

Rob Church
On 07/03/07, aretai aretai <[hidden email]> wrote:
> I'd prefer to keep it as it is..., but well this makes a coding (i.e.
> linking to this images from external application) a little bit tricker.
> Coding will be probably performed by non-MW programmer so want to make his
> task a little bit easier.

I think someone else pointed out the FilePath extension in Subversion,
which issues an HTTP location header with the full URL to the image,
which can be used in things like <img> tags, etc.


Rob Church

_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://lists.wikimedia.org/mailman/listinfo/mediawiki-l