PHPackages                             swiftotter/image-import-path-fix - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. swiftotter/image-import-path-fix

ActiveMagento2-module[Utility &amp; Helpers](/categories/utility)

swiftotter/image-import-path-fix
================================

N/A

v1.2(8y ago)14271OSL-3.0PHPPHP ~7.0.0

Since Jan 9Pushed 8y ago2 watchersCompare

[ Source](https://github.com/SwiftOtter/ImageImportPathFix)[ Packagist](https://packagist.org/packages/swiftotter/image-import-path-fix)[ RSS](/packages/swiftotter-image-import-path-fix/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (3)DependenciesVersions (4)Used By (0)

System &gt; Import &gt; Images Fix
==================================

[](#system--import--images-fix)

\##Installation:

- `composer require swiftotter/image-import-path-fix`
- `php bin/magento module:enable SwiftOtter_ImageImportPathFix`
- `php bin/magento setup:upgrade`
- `php bin/magento setup:di:compile`

\##Description:

Where to begin on this one? This bug fix is for Magento 2.1.2 (latest as of 1/9/17). Nginx and MySQL. Folder structure is a little different than normal, so that may account for why this bug wasn't found sooner. Nginx is pointed to `pub/index.php`.

Folder structure:

- current &gt; symlinked to: /path/to/releases/release-2
- link
    - media
        - import
        - catalog
            - product
    - var
        - log
        - report
- releases
    - release-1
        - app
        - pub
            - index.php
            - media &gt; symlinked to: link/media
        - ...
        - var &gt; symlinked to: link/var
    - release-2
        - app
        - pub
            - index.php
            - media &gt; symlinked to: link/media
        - ...
        - var &gt; symlinked to: link/var

### Issue description:

[](#issue-description)

**The root issue is inconsistent handling of the `pub/` folder.**

Magento's initial file is `pub/index.php`. The `cwd` for this file is `/path/to/releases/release-2/pub/`. However, a feature of `\Magento\Framework\Filesystem\Directory\ReadInterface->getAbsolutePath()` is that it removes `/pub` from the path structure. This works well, until trying to use relative paths in combination with vanilla PHP functions, such as `is_readable($relativePath)`.

There are two facets: the `tmp` directory (where the files are coming from) and the `dest` directory (where the files are going to). Both have unique challenges.

### `tmp` directory:

[](#tmp-directory)

The `tmp` directory comes from the "Images File Directory". Magento strips out the reference to `pub/` at the end. As the `media` folder is inside the `pub` folder, it is unclear as to how to reference this folder. The patch deals with this by providing an additional lookup path.

I am not sure if this was also causing issues, but the `tmp` directory was relative and not absolute. This caused problems for the `dest`directory, so I have patched the `tmp` as well.

### `dest` directory:

[](#dest-directory)

This was home to another inconsistency. When creating / setting the folder in `\Magento\CatalogImportExport\Model\Import\Product->_getUploader`, the paths are initially checked as absolute paths. However, when it is used in `\Magento\Framework\File\Uploader->save()`, the `validateDestination()` is called. Inside this function is the use of `is_writable()` with a relative path.

My solution is to make the destination file be absolute. This seems to fix the problem and should work with any environment.

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~196 days

Total

3

Last Release

3066d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0caf0b4442f87bd5fa93aec6a384421bb76a9f4b2e316e3e30a642783512a482?d=identicon)[JosephMaxwell](/maintainers/JosephMaxwell)

---

Top Contributors

[![JosephMaxwell](https://avatars.githubusercontent.com/u/1151186?v=4)](https://github.com/JosephMaxwell "JosephMaxwell (5 commits)")

### Embed Badge

![Health badge](/badges/swiftotter-image-import-path-fix/health.svg)

```
[![Health](https://phpackages.com/badges/swiftotter-image-import-path-fix/health.svg)](https://phpackages.com/packages/swiftotter-image-import-path-fix)
```

###  Alternatives

[njxqlus/filament-progressbar

This Filament component shows a progress bar at the top of the page when we navigate from one page to another

2697.8k1](/packages/njxqlus-filament-progressbar)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
