Images, Videos &amp; Podcasts - MODX Community Forums <![CDATA[Limiter code works in other websites but not ModX, please help! :)]]>
<!-- MAIN (Center website) -->
<h2>Programming Modules</h2>
<div id="myBtnContainer">
<div class="main">
<script type="text/javascript">// <![CDATA[
pagetitle = "[[*pagetitle]]";
// ]]></script>
<button class="btn active" onclick="filterSelection('all')"> Show all</button> <button class="btn" onclick="filterSelection('preschool')"> Pre-school</button> <button class="btn" onclick="filterSelection('ozobots')"> Ozobots</button></div>
<!-- Portfolio Gallery Grid -->
<div class="row">
<div class="column preschool">
<div class="content">
<h4><img style="border: 15px solid white;" title="Babies' First Books" src="babybook.jpg" alt="Babies' First Books" width="150" height="150" />  <img style="font-size: 1em; font-weight: normal; border: 15px solid white;" title="Another pre-school program" src="babybook.jpg" alt="Another pre-school program" width="150" height="150" /></h4>
<!-- END GRID --></div>
<!-- END MAIN --></div>
<script type="text/javascript">// <![CDATA[
function filterSelection(c) {
var x, i;
x = document.getElementsByClassName("column");
if (c == "all") c = "";
for (i = 0; i < x.length; i++) {
w3RemoveClass(x[i], "show");
if (x[i].className.indexOf(c) > -1) w3AddClass(x[i], "show");

function w3AddClass(element, name) {
var i, arr1, arr2;
arr1 = element.className.split(" ");
arr2 = name.split(" ");
for (i = 0; i < arr2.length; i++) {
if (arr1.indexOf(arr2[i]) == -1) {element.className += " " + arr2[i];}

function w3RemoveClass(element, name) {
var i, arr1, arr2;
arr1 = element.className.split(" ");
arr2 = name.split(" ");
for (i = 0; i < arr2.length; i++) {
while (arr1.indexOf(arr2[i]) > -1) {
arr1.splice(arr1.indexOf(arr2[i]), 1);
element.className = arr1.join(" ");

// Add active class to the current button (highlight it)
var btnContainer = document.getElementById("myBtnContainer");
var btns = btnContainer.getElementsByClassName("btn");
for (var i = 0; i < btns.length; i++) {
btns[i].addEventListener("click", function(){
var current = document.getElementsByClassName("active");
current[0].className = current[0].className.replace(" active", "");
this.className += " active";
// ]]></script>

It works on my computer when I save it as a .html file, but not when I use HTML to upload it to ModX. When I click on the limiter, nothing happens in ModX.

]]> Tue, 12 Mar 2019 03:45:24 +0000
<![CDATA[Pthumb Stopped Working]]>
(ERROR @ /root/core/components/phpthumbof/model/phpthumbof.class.php : 156) [pThumb] Resource: 154 || Image: assets/images/used/upright/File 1.JPG
Could not cache thumbnail to file at: /root/folder/image-cache/images/used/upright/File 1.987503d0.jpg
Resizer debug output:
    [0] => Resizer v1.0.1
    [1] => Using GD
    [2] => GD: assets/images/used/upright/File 1.JPG may exceed available memory  ** Skipping **

Image sizes are not overly large at around 50kb. Image paths all look correct.]]> Mon, 01 Oct 2018 10:56:02 +0000
<![CDATA[ImagePlus Default Operation - nothing created]]>
Using ImagePlus with a default like subfolder/picture.jpg and pThumb with Cache pthumb.use_ptcache so image should appear in assets/image-cache.
Using Media-Sources too with basepath baseurl set to assets/img/ (relative) - which may be relevant.

I've tried two approaches and expect both to fall back on the default if nothing added to the TV on the resource. But they don't, and show slightly different outputs.

Approach 1) TV1 has input/output set to Image+. A Default as above. And output tab has no phpthumb params, no output chunk and Generate Thumb is No.
Then in Template/Chunk a snippet call
[[ImagePlus? &tvname=`tvImage1` &options=`&h=200` &type=`tpl` &tpl=`tripleImagePlus-srcset` ]]

Where tripleImagePlus-srcset is much the same as in the Responsive Image <picture> part of the example

This works when an image is added to the TV in a Resource. But nothing is output when the TV is left blank - no html - just a hole in my site. Expected the picture element using the default image.

Approach 2) Another Image+ Input/Output TV with a Default as above and this time the Output Chunk is set to tripleImagePlus-srcset
Then in the Template a simple [[*tvImage2]]. Does the trick if an image is added in the Resource TV. Good.
And it has a path like

This time though, when the Image+ TV is left blank you see a simple string in the browser which is the default e.g. subfolder/picture.jpg. In other words the Output Chunk is ignored. But at least it has a go at getting a default. However, the Media Source isn't added ( assets/img/)

I think this is related to these issues which resulted in 2.6.3 And this epic which led to commits around Oct 1, 2016

I always make a mess of leading/trailing slashes so I may have got something wrong there but what I think is happening is:

core/components/imageplus/model/cropengines/PhpThumbOf.php line 130
if (file_exists($imgPath)) {
   // run phpthumbof stuff
 } else {
    $url = $data->sourceImg->src

I think Jako did this to stop phpthumbof running when a default is used as it could end up showing the full server path - not good.
And the sourceImg->src is presumably my default value which simply gets passed through. Missing the media-source bit.

With Approach 2) it looks like the Output Chunk doesn't run so I don't get the <picture> stuff.
With Approach 1) nothing appears, not even the string of the default.

I suspect there is a logic in the default iamge not being processed by any imageplus/phpthumb stuff as by definition it can't have been cropped or whatever so should simply be passed through as is. But I'd have thought that something should make it through to the Chunk Template referenced in either &tpl or the Output Chunk.

Spotted this in the Error Log: (ERROR in Image+ @ /home/.../core/components/imageplus/model/cropengines/PhpThumbOf.php : 54)
The value is empty. Could not prepare the output.

Had a look but it seems the imageplus code gives up very early if there is no source.

Found this public $version = '2.6.2'; in core/components/imageplus/model/imageplus/imageplus.class.php yet system claims to be up to date with 2.6.3.

Revo 2.5.6. Imageplus 2.6.3

Parthian]]> Wed, 28 Jun 2017 02:11:32 +0000
<![CDATA[Support/Comments for imageSlim]]>
I've been working on a new add-on to address the ol' problem of clients and users sticking huge images in Content and richtext TVs and then "sizing them down" by simply changing the dimensions. I know there's another add-on or two which do something similar; I've tried to avoid their shortcomings and add some new features as well.

Anyway, my extra is called imageSlim:
The documentation is on GitHub:

I gave it a beta designation mainly because content and system configurations are so variable and while I've tried to anticipate all the possibilities, I'm sure I haven't thought of everything. For what it's worth, I've got it running on two sites at the moment and haven't come across any bugs yet.

Well, take a look and let me know if there's anything that needs fixing or if there's another feature you'd like to see.]]> Thu, 24 Nov 2016 01:47:46 +0000
<![CDATA[Plugin which create multiple thumbnails with different size on upload image. Is it exists?]]> Mon, 21 Nov 2016 09:02:59 +0000 <![CDATA[Cliche Gallery Upload Stopped]]>
Error: cliche.upload_max_filesize

Revo 2.2.2 trad
Cliche 1.0.1
]]> Tue, 20 Sep 2016 10:36:29 +0000
<![CDATA[pThumb stripping UTF-8 from filenames]]>
To fix, upgrade your version of PHP and set your locale in the MODX system settings to include UTF-8.

Mine is: zh_HK.UTF-8

See closed issue here:

Hope this saves someone some time smiley]]> Wed, 11 May 2016 12:04:17 +0000
<![CDATA[Incubator for MODX image gallery EXIF / IPTC capabilities]]>
- EXIF extraction capabilities
- IPTC extraction capabilities
- Geotagging capabilities

Please post your ideas & suggestions here.
If some image gallery extra developer planed to add this feature, I'm ready to spend time for tests & debugging...]]> Fri, 15 Apr 2016 02:47:12 +0000
<![CDATA[pThumb uses server PATH instead of base URL ?]]>
I have a strange problem with a customer site.
Using pThumb seems to generate the thumbs, but the snippet call generates an image path based on the server path and not the base url.

Chunk: imageGalleryRow

<li><a href="[[getImageSize:gt=`490`:then=`[[+image:phpthumbof=`w=490&zc=1`]]`:else=`[[+image]]`? &dimension=`width` &src=`[[+image]]`]]" class="fancybox" rel="group" title="[[+text]]"><img src="[[+thumbnail:is=``:then=`[[+image:phpthumbof=`w=160&h=160&zc=1`]]`:else=`[[+thumbnail]]`]]" alt=""></a></li>


<li><a href="/customers/0/0/0/" class="fancybox" rel="group" title="Back stage at Onstage, Scandinavium"><img src="/customers/0/0/0/" alt=""></a></li>

The image path in the TV "image" is correct, and the thumbnails are generated just fine. If I remove the "server path", using Developer tools, and only request the URL starting from "/assets..." the image is loaded in the frontend.]]> Tue, 05 Apr 2016 11:05:48 +0000
<![CDATA[Galleries in MODX]]> Last few months I was in search for good CMS (front-end developer friendly) so I can move from Wordpress because of various reasons.
I really like the way MODX works. Template engine, chunks, snippets, it all make sense to me.

What I was wondering if there is any way of inserting image gallery inside rich text editor?

When I'm making design, my usual routine is to make a "basic page template" design with predefined/predesigned elements which are usually available inside rte. Headings, lists, images, galleries, tables and quotes. And the end users can build page with them.

I saw tutorial how Gallery extra works and building template just for gallery seams not very flexible. I want for my clients to have ability to insert gallery where they want inside page.
Building gallery with MIGX also requires predefined place in template as I understand.
Is there a way to do that in MODX?

Thanks.]]> Mon, 29 Feb 2016 04:32:03 +0000
<![CDATA[Can't Use Image+ TV]]>
Image+ Error: Invalid Media Source

Server: MODX Cloud
Image+ TV: 2.1
PHPThumbOf: 1.4
MODX: 2.2.8 (same issue with 2.2.6)

Any tips? Media Sources are set to the Filesystem.]]> Tue, 26 Jan 2016 07:01:27 +0000
<![CDATA[Image+ not displaying Input Options]]> As title says, I can't see custom Input Options for Image+ template variables. As i select Image+ from the dropdown menu, the bottom part of the Input Options form disappears: i can only see the Option Values and Default Value fields. This behaviour persits also if I select another TV type.

I'm currently using MODX Revolution 2.4.1-pl with PHP Version 5.5.15.

Thanks in advance for your help!

]]> Fri, 09 Oct 2015 10:15:31 +0000
<![CDATA[ImagePlus + migxResourceMediaPath]]> Media source has the template:

Works fine when I'm displaying the image on the resource, where it is actually uploaded (e.g. with id 1).
But when I try to call that image (the image+ tv) from another resource (e.g. id 2), then of course the images src reads
instead if id 1, therefore the image is not found.

I have tried setting option 'docid' to 1, also setPlaceholder('docid',1) before calling the snippet.

Is there a way to make that work, meaning to set the correct resource id?]]> Tue, 11 Aug 2015 12:00:06 +0000
<![CDATA[pThumb filters not working on Revo 2.2.16]]>
Both codes below don't have the mask:

<img src="
" />

<img src="[[+tv.itemImage=`&f=png&w=336&h=195&zc=1&fltr[]=mask|assets/templates/images/contentpage-img-mask.png`]]" alt="" width="336" height="195" />

The debug says:

[2015-02-27 16:24:02] (ERROR @ /index.php) [pThumb] Resource: 397 || Image: /home/mydomain/domains/
:: Processed ::
Resizer debug output:
    [0] => Resizer v1.0.1
    [1] => Using GD
    [2] => Input options:
  'fltr' => 
  array (
    0 => 'mask|assets/templates/images/contentpage-img-mask.png',
  'f' => 'png',
  'w' => '336',
  'h' => '195',
  'zc' => '1'
    [3] => Original - w: 3504 | h: 2336 (8.19 MP)
    [4] => New - w: 336 | h: 224
    [5] => ZC - start: (0, 14) | box: 336x195 px
    [6] => Wrote /home/mydomain/domains/
    [7] => Dimensions: 336x195 px
    [8] => Execution time: 1330 ms

there is no mention at all of the processing of the filter. When I try with the wmi filter it does show up in the debug lines.

I also uploaded the phpThumb demos and tests and all is ok, GD is running 'bundled (2.0.34 compatible)'.

I'm running out of ideas how to fix this.. Hope someone on this forum knows what could be going on.

I did see some bugfixes in the changelog for phpThumb, could that be related?

This is a big problem for my client because the site looks bad now without the filters.

Thanks for any help!]]> Wed, 15 Jul 2015 04:40:53 +0000
<![CDATA[pThumb "false" error log]]>
I'm using pThumb 2.3.3-pl in a pdoMenu TPL

tpl code:
    	<img src="[[+id:pdofield=`imgServ`:phpthumbof=`h=200`]]" class="img-responsive">

and i get thumbnaill image: <img src="/assets/image-cache/media/servizi/bagno.83fc386f.jpg" class="img-responsive">
everything works correctly

but returns a large number of errors in the log!

[2015-06-30 08:38:19] (ERROR @ /index.php) [pThumb] Resource: 1 || Image: (none)
File not found: /home/xxxx/public_html/1076  *** Skipping ***
]]> Tue, 30 Jun 2015 03:07:50 +0000
<![CDATA[Resizing large format image phpThumbOf / pThumb]]>
My client uploads very large photos (6000x4000). pThumb is my resizer of choice but looks to choke on large format images...
If i try to resize the 6000px to 2000px or even 1500px I end up with a blank page. phpThumbOf / pThumb creates a file nicely if i drop the width to 1000px or lower.

I need to resize these pictures for a bg-image (parallax) 2000x700

- I also noticed that the zoom-cropping feature only acceptes zc=1 (used to be all orientations).
- Resizer set to "yes" also does not generate any thumbnails

Does anyone have any experience in solving this?
(obvious to change to phpThumbsUp because this does the resize as wanted)

My env: PHP 5.5, MODX 2.3.3]]> Sat, 27 Jun 2015 04:58:01 +0000
<![CDATA[Option to ignore/skip file types (animated gif) with phpthumb / imageslim?]]>
I'm using imageslim to resize and add a watermark to images which are placed in the content field of a page (Like this:

Unfortunately also the animated gif's are being processed, and loses their animation. My question is; is there a way to tell phpthumb (phpthumbof, pthumb, pthumbsup, any will do) to ignore/skip certain files, like gif's, like &skip=`gif`? Anyone ever made something before?

Thanks for any help!

MODX 2.3.3]]> Wed, 20 May 2015 06:10:58 +0000
<![CDATA[DirectResize error.]]>
DirectResize causes a 'crash' in MODx (Revo 2.3.3) when using contexts or when change the core folder location.

I think is the line (in plugin code):
include "core/components/directresize/elements/plugins/plugin.directresize.php";
Should be changed to?:
include MODX_CORE_PATH."components / directresize / elements / plugins / plugin.directresize.php";
?]]> Tue, 03 Mar 2015 06:05:09 +0000
<![CDATA[Restarting phpThumbOf development]]> issues and pull requests folks submit have been piling up with no response.

In an effort to get things restarted, I've released a fork of phpThumbOf called pThumb. I've tried to address most of the open issues, especially the bugs with file naming which bite people pretty regularly. I also added a few new features that people have suggested, like a global JPEG quality setting, an option to update a cached image when the original has changed, or the addition of the resource ID to error messages in the log to make tracking down problem images easier. Performance has been improved significantly, especially for sites with lots of images or the same image on multiple pages. pThumb will happily run when MODX is installed in a subdirectory. Cache cleanup actually works now, and I changed the phpThumbOfCacheManager plugin to clean up the cache instead of deleting everything, which I think is generally a better choice. See the GitHub page for a more complete list.

It's very simple to install: just uninstall phpThumbOf and install pThumb. Since it uses the same namespace and component names, anything which used phpThumbOf will use pThumb with no modification.

I've marked it as a beta version for now, only because it hasn't been tested too widely yet. For what it's worth, I've got it running on a couple production sites with no problems. But I'd appreciate it if a few people would try it out and let me know if they come across any bugs. You're guaranteed to get a response faster than if you'd opened an issue with phpThumbOf ;-)

One thing I haven't done anything with is the Amazon S3 functionality. The SDK is rather dated now, and I'm sure things could be improved some, or at least modernized. I might get around to working on this but since it's not something I currently use, it might be awhile. If somebody who's familiar with this would like to have a go at it, I'd be very appreciative.]]> Fri, 27 Feb 2015 05:41:33 +0000
<![CDATA[Image Path from TVImage]]>
I'm trying to extract just the image path to use for open graph in the head section of my templates - anyone got an ideas as to how I would achieve this?]]> Sun, 01 Feb 2015 04:13:30 +0000