Modifying the image processor to optionally add imported images to the database

A proposed solution to #114. Note that this does not yet allow the user to specify an alternate media db, it just uses the db that Magmi is configured to use. Since it uses the target file, it should work with remote images as well as local images.
So this "database" storage is only some "backup" storage solution from
magento point of view. i suppose the code that loads images finally serve
it from the filesystem , using only db to restore file if not present at
the time it is accessed.
Interesting !


2014-09-24 18:08 GMT+02:00 Tommy Goode <notifications@github.com>:

> In
> magmi/plugins/extra/itemprocessors/imageprocessor/imageitattributeemprocessor.php:
>
> > @@ -542,6 +542,52 @@ public function copyImageFile($imgfile, &$item, $extra)
> >              else
> >              {
> >                  @$this->_mdh->chmod("$l2d/$bimgfile", Magmi_Config::getInstance()->getFileMask());
> > +
>
> Magento is strange in that even if media storage is set to "database", it
> still wants the file to be stored in the standard media directory: if the
> image doesn't exist in the file system when a request comes in, it actually
> pulls the image out of the db and saves it to the fs, and then serves it
> from there. So it's advantageous to still store the file in the media
> directory when saving it to the db.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/dweeves/magmi-git/pull/115/files#r17981023>.
>