One thing I did not like about OXID from the very beginning was the, in my view, very cumbersome way of defining article images, particularly the need to upload each image to be used (icon, thumb and zoom) individually…
Being used from xtComerce and other shops, that you define and upload [B]one [/B]“master”-image, from which the shop software automatically creates the pictures it uses (in OXID: icon, thumb and zoom) itself, I (and many others) found, that this was too complicated.
Some months agao, I therefore made a “feature request” to change this, and add a xtComemrce-like capability to OXID in that respect, describing in some detail how I believed that could be implemented without too much effort.
As nothing has happened so far in that area, I have begun to implement that capability myself.
(As it turned out, my original proposal was “dead right”, and the capability described was not too complicated to be implemented!)
The way it is done is like follows:
-
To the “[B]oxarticles[/B]” database table has been added the “[B]oxmasterimage[/B]” field
-
The “[B]master[/B]” subfolder was added to the “[B]pictures[/B]”-folder
-
The admin-template for image manipulation was extended with the necessary fields to allow management of a “master”-image (see picture attached).
[B]If [/B]during one transaction a “master”-image is uploaded, the new functionality will [B]substitute [/B]the picture information for icon, thumb and zoom, which PHP provides (i.e. their “$_FILES”-structure), with the necessary information derived from the “master”-images’ “$_FILES”-structure.
This approach has the inherent “beauty”, that the further image-processing can be done by the available OXID image-processing routines!
The “master”-image is stored in the “master” subfolder in “pictures”, and the pictures for icon, thumb and zoom are resized based on the “master”-image and stored in their corresponding directories.
(This implies, of course, that the “master”-image must be at least as big, as the defined size for the zoom-image!)
There needed to be made some modifications to some modules, but, at the end of the day these were surprisingly few changes…
(Another proof of the fact, what a sound base the OXID software provides. Clever asses, these OXID developers!)
[B] I have got this part[/B][B] working[/B][B] already![/B]
(One thing I am not yet fully content with here, though, is the fact, that I had to do some necessary modifications to “[B]oxutilsfile[/B]” in the core module directly, because when “[B]oxutilsfile[/B]” gets activated, the OXID module subclassing capability is not yet active… [B](Any ideas on that, anybody?[/B])).
But there is still more!
Now that we have our “master”-image in place, we can adress another fine capability: [B]resizing[/B] [B]existing[/B] images, if you change the desired image dimensions…
(xtCommerce has an “Image manipulator” for that purpose.)
This capability was also sorely missed, but just not possible so far, due to the lack of a “master”-image that could be resized to yield the new icon, thumb and zoom images…
I have started work on such an “Image updater” already, which will do just that: resize the [B]existing [/B]images to reflect changes in image-dimensions.
What the “Image updater” will also be able do for you (if you should wish):
[B]If (and oly if!) [/B]a “zoom”-image is defined for an article , this “zoom”-image will become the new “master”-image, so that the old way of doing things can be converted to the new one!
For those still wanting to do it [B]the old hard way[/B]: [B]rejoice[/B]: you can do that, too!
As long as no “master”-image is uploaded in a transaction, all works like before!
I hope to be able to release that capability within a few days, sort of a x-mas present to the community!