Page MenuHomePhabricator

Allow namespace and category designation for Images/files - and subsequent namespace/category-based functionality enhancement with images
Closed, ResolvedPublic

Assigned To
Authored By
May 12 2007, 8:28 PM
Referenced Files
Nov 21 2014, 9:39 PM
F3859: ImageNS1_10.patch
Nov 21 2014, 9:39 PM
F3857: SpecialUpload.patch
Nov 21 2014, 9:39 PM
F3855: img_auth.patch
Nov 21 2014, 9:39 PM
F3856: img_authNS.php
Nov 21 2014, 9:39 PM
F3853: ImageFunctions.patch
Nov 21 2014, 9:39 PM
F3854: Title.patch
Nov 21 2014, 9:39 PM
F3852: Image.patch
Nov 21 2014, 9:39 PM


If namespaces were allowed as sub-categorization of images, a large number of features could be
enabled through extensions and other customization, including:

  • Namespace protection on images
  • Categorization, sorting, search by namespace (and category) of images
  • Tree-structuring of images (eg, sub-directory type listings using NS and designated categories)

The proposed mechanism would be two-fold:

  1. Allow namespace in image link (eg., Image:[ns]:[Image Name])
  2. Include namespace in file hash (eg., [ns]/[category]/[hash]/file.img

This functionality can be implemented by patching 4 files and is completely reverse compatible with
previoius versions. Additionally, the proposed patches require this functionality to be enabled
(disabled by default), and poses almost no overhead when not used.

It provides a platform for much needed image categorization, including enhanced listing and
segregation with very little cost.


SpecialUpload.php - modify to allow uploading of image using [ns]:[Image Name] format, assign to
ns, and save in [ns]/[category]/[hash]/file.img hashed format
Image.php - parse ns/category in image reference (if exists)
ImageFunctions.php - parse ns/category in image reference (if exists)
Title.php - needs two set property functions


img_auth.php - enhance to use enhanced hashing or (preferable), new img_authNS.php which does same
with NS protection checking (old img_auth would still work, just wouldn't have
overhead/functionality of NS checking).

Version: 1.10.x
Severity: enhancement



Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:39 PM
bzimport set Reference to bz9887.
bzimport added a subscriber: Unknown Object (MLST).

Contains required patch files (in diff formats) and actual files

Contains the diff files necessary to complete

attachment ignored as obsolete

Patches required to SpecialUpload

attachment SpecialUpload.patch ignored as obsolete

Image.php patches

Patches required for image.php


ImageFunctions.php patches



Patches required for Title


img_auth.php patch - not recommended, pref new img_authNS.php


img_authNS.php alternative to img_auth.php



TimStarling is updating the file repository handling process, will include ability to do this via extension
versus patching - highly desireable. Included patches with this bug can be applied against 1.10.

TimStarling: after image changes, I think you might be able to implement this as a plug-in repository, well,
plus any UI changes, but I don't think you'll have to make backend patches. The way it works is that you
specify a repository class to be used as the local repository

ayg wrote:

Diffs should normally be placed in one file so they can be read and applied
more easily.

SpecialUpload.php Patches - corrected

Had typo in orignal patch - accidently uploaded wrong version


All patches in a single diff file - as per simetrical

Includes patches to img_auth.php - not preferred, should use img_authNS.php as

attachment AllPatches.patch ignored as obsolete

Contains required patch files (in diff formats) and actual files

Fixed bug in non-namespace typo


All patches in a single diff file - as per simetrical

Fixed minor bug in non-namespace typos


This seems too hierarchical and hard-wired, the opposite of the sort of
categorization and tagging we like to see on a wiki.

I don't see it as being very useful.

Was able to use TimStarling's FileRepo system to create a new local Repo - NSFileRepo. As of 1.16.0, will require no patches to implement. Minor patching reqiured for versions 1.13.0 through 1.15.1

Gilles raised the priority of this task from Medium to Unbreak Now!.Dec 4 2014, 10:11 AM
Gilles moved this task from Untriaged to Done on the Multimedia board.
Gilles lowered the priority of this task from Unbreak Now! to Medium.Dec 4 2014, 11:20 AM