# phpThumb / pThumb - Ignoring Contexts

**URL:** <https://community.modx.com/t/phpthumb-pthumb-ignoring-contexts/2043>\
**Category:** Extras\
**Created:** [December 25, 2019, 4:45am UTC](https://community.modx.com/t/phpthumb-pthumb-ignoring-contexts/2043 "2019-12-25T04:45:16Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Mr\_JimWest](https://community.modx.com/user_avatar/community.modx.com/mr_jimwest/32/112_2.png) [@Mr\_JimWest](https://community.modx.com/u/Mr_JimWest)\
**Post date:** [December 31, 2019, 11:31pm UTC](https://community.modx.com/t/phpthumb-pthumb-ignoring-contexts/2043/4 "2019-12-31T23:31:55Z")

</div>

Thanks for the reply. Good call.

I just saw this post from @bobray too:

> [@Images not shown in second context](https://community.modx.com/t/images-not-shown-in-second-context/2066/8):
>
> Note that it’s a modx convention that all path and URL settings end in a slash. So the standard approach is to have all baseURL settings end in a slash and never use a slash at the beginning of anything that will be added to them.

I changed all of the paths to relative, no change. 😭

### Edit

I am continuing to play with this, here is the latest log:

```
[2019-12-31 21:02:10] (ERROR @ XXX/core/components/phpthumbof/model/phpthumbof.class.php : 156) [pThumb] Resource: 5 || Image: _files/images/articles/1.jpg
Could not generate thumbnail
phpThumb debug output:
    [0] => phpThumb() v1.7.15-201902101903 in file "phpthumb.class.php" on line 229
    [1] => setSourceFilename(XXX/_files/images/articles/1.jpg) set $this->sourceFilename to "XXX/_files/images/articles/1.jpg" in file "phpthumb.class.php" on line 294
    [2] => Addding ImageMagick formats to $AvailableImageOutputFormats (text;ico;bmp;wbmp;gif;png;jpeg;webp) in file "phpthumb.class.php" on line 999
    [3] => $AvailableImageOutputFormats = array(text;ico;bmp;wbmp;gif;png;jpeg;webp) in file "phpthumb.class.php" on line 1005
    [4] => $this->thumbnailFormat set to $this->config_output_format "jpeg" in file "phpthumb.class.php" on line 1016
    [5] => $this->thumbnailFormat set to $this->f "jpeg" in file "phpthumb.class.php" on line 1023
    [6] => $this->thumbnailQuality set to "75" in file "phpthumb.class.php" on line 1033
    [7] => ResolveFilenameToAbsolute() prepending $this->config_document_root (sites/site_a/) to $filename (XXX/_files/images/articles/1.jpg) resulting in ($AbsoluteFilename = "sites/site_a//XXX/_files/images/articles/1.jpg") in file "phpthumb.class.php" on line 1338
    [8] => resolvePath: sites/site_a//XXX/_files/images/articles/1.jpg (allowed_dirs: Array
(...

```

This could be a major part of my issue…it looks like it’s prepending my context path to the full root path of my image. That will never work! My context path needs to be between the path of the image and the root. ☠

````auto
[7] => ResolveFilenameToAbsolute() prepending $this->config_document_root (sites/site_a/) to $filename (XXX/_files/images/articles/1.jpg) resulting in ($AbsoluteFilename = "sites/site_a//XXX/_files/images/articles/1.jpg") in file "phpthumb.class.php" on line 1338```
````

---

_[View the full topic](https://community.modx.com/t/phpthumb-pthumb-ignoring-contexts/2043)._
