Jump to content

robinc

Members
  • Posts

    23
  • Joined

  • Last visited

Posts posted by robinc

  1. On 21/07/2017 at 4:55 AM, Robin S said:

    I forked this module and made it PW3 compatible. See the readme and the commit for details of what was changed.

    https://github.com/Toutouwai/ProcessBatcher

    If folks want to test it and report back I can make a pull request for @Wanze.

    @tpr, I hid the AdminOnSteroids datatables filterbox and the title case-change button because the layout was a bit messed up. Maybe you could take a look at that when you have time? 

    Works fine for me :) thanks!

    Would love to see this pulled back into the main module

    • Like 1
  2. What is the best way to bulk upload multiple images? Similar to how you can with an images/files field, but would need each page name to be unique autogenerated, maybe name and/or title from each filename, or incremental.

    page structure: i have container page( or pages for separate groupings), with a child page for each image

    I Recently came across this module - it's really helpful! :)

    Thanks

  3. Sure. For this, widgets are configurable for each instance that exists. Each page should be able to as many as needed in any order, possibly 2+ of the same type on a page, with different config set.

    Example widgets:

    Custom menu, contact form, wysiwyg area, show latest article (with link to more).

    I get that each widget type would be a template, and each instance a page on the back end.

    Want to be able to make changes to all widgets on a page in one screen though, not constantly navigating to different places.

    Thanks

  4. I am making a website where on multiple pages i would like to have swappable customisable 'widget's or cms editable areas.

    Can anyone suggest how to implement a good visual way of doing this? (eg. Like the repeater field but each entry is an inline editable widget)

  5. I have noticed an issue with the compiler that may be related or the cause of this issue.

    If you have odd code snippets within php comments  /* **stuff** */   (eg. mismatched/nested  open/close codeblock <? or ?> then following code may NOT be passed by the compiler - leaving it without the namespacing - hence the Class missing error message.

    In my own code, i was using a call to wire(), which should have been compiled to \ProcessWire\wire() but was not.

  6. With any website, there is the possibility of db issues - overloaded server, network connectivity if the db is on another machine in the hosting network, etc.

    I would love to see a feature where if there is any reason the db fails or cannot be accessed, then pw displays a dedicated page that is stored in the filesystem - instead of displaying nothing, or an ugly mysql error. Obviously it would be good to log the error, and possibly send a notification to the admin (email?).

    This gives us the opportunity to still present a professional front (albeit with no functionality) while problems are resolved behind the scenes. I cannot think of a company I have worked for that hasn't had db errors at times

    What are your thoughts?

    • Like 2
  7. hi,

    Couple of suggested edits to module:

    default config for:

    'attributes' => '',
    'dataAttributes' => '',
    

    should probably both be array() - as otherwise the array_merge function in attributes() will not work correctly to add bulk attributes to a tag.

    Also, the exmaple 5 shows the tag() function passing in attributes, but this is not supported in the actual code. I suggest adding an additional argument to tag, ie:

    tag($tag, $args /*custom tag structure*/, $attr=array())

    or similar, and update the code in the function to support this data.

    Nice module anyway :) I like it!

  8. I am using the Multisite.module to run several (similar/related) websites off a single PW-site and database.

    Adding new sites was as simple as adding the domain to the config box, and a top level page of the same name.

    However, since an upgrade of PW, I now also have to update my site/config.php file with each extra domain, i.e.

    $config->httpHosts = array(
      'mydomain.com', // our primary hostname
      'related.mydomain.com', // related website  
      );
     

    Otherwise the site will throw a 404 page not found.

    Leaving a blank httpHosts will allow all hostnames, but causes a warning in the back-end

    Unrecognized HTTP host:'mydomain.com' - Please update your $config->httpHosts setting in /site/config.php

    Can anyone advise how best to update Multisite.module?

  9. I have a suggestion, may or may not affect the issue above, but was causing the preview to render the page twice:

    in function init(), execute calls page->render(), then it is rendered again in the function changeView() with the preview data.

    I found changing:

    $this->addHook('ProcessPageView::execute', $this, 'changeView');
    

    to:

    $this->addHookBefore('ProcessPageView::ready', $this, 'changeView');
    

    and removing:

    // return the preview merged page
    $event->return = $page->setOutputFormatting(true)->render();
    
    

    Works for me to view unpublished pages, etc as I have enough access to view (i.e. I can already edit it in the admin).
     

  10. I don't like HTML in my template, I like php strings of HTML better. At the end it just makes it more readable. 

    Mostly <?php is only used ones at the top of the file and thats it.

    What do you use to write code in?

    I am using Notepad++, which gives very useful readable syntax highlighting, and tag/bracket pair matching, but does nothing to help make php strings of HTML more readable.

    Any suggestions?

  11. @robinc: which version of ImagickResizer do you use? Above in a code comment from you I have seen v 0.0.5 which is a very early version.

    I was using the version included in the v4 download (hence still v0.0.5)

    note: the zip still has pwire 4.2.1, so need to upgrade that first before i can use the latest ImagickResizer module.

    Any chance you could update the zip to latest? :rolleyes:

  12. few more things i have noticed regarding gamma issues, by playing with the special image  on http://www.4p8.com/eric.brasseur/gamma.html

    gamma_dalai_lama_gray.jpg

    Even with the correct gamma correction before/after resize, GD2's jpeg encoding at 100% quality is still appalling - mangles images that if saved as pngs are fine. (took me a while to isolate as artifacts can look similar as if the gamma was incorrect).

    Using Imagick, I still need to add in the gamma correction similarly to  that in ImageSizer.php. (which i think should be 2.2, not 2.0 as hardcoded).

    The default getImageGamma() for a new Imagick object is coming up as 1/2.2 (0.454545), which still needs to be added again via $im->gammaImage() to correctly linearize for resizing. (ie. not do gammaImage(2.2) to push it back to 1 before resizing). Hope this makes sense.

            $this->imageGamma = $this->im->getImageGamma();
    
                if ($this->imageGamma && $this->imageGamma!=1) {
                   $this->im->gammaImage($this->imageGamma);
                }
               
               // resizeImage(), sharpen, etc
               // ......
    
                if ($this->imageGamma && $this->imageGamma!=1) {
                   $this->im->gammaImage(1/$this->imageGamma);
                }
    
    
    • Like 1
  13. but there is an issue I have encountered on two different machines: It is called / processed two times for every image call. I have uploaded the module together with some debugging code to github.

    looks like the imagick resizer module is not set to singleton, and I think it should be:

        public static function getModuleInfo() {
            return array(
                'title' => 'Imagick Resizer',
                'version' => 5,
                'summary' => 'A module for replacing GD resizing with Imagick',
                'href' => 'https://processwire.com/talk/topic/5889-image-quality-problem-on-resize/',
                'singular' => false,
                'autoload' => true
                );
        }
    
    

    should be

     'singular' => true,
    
    • Like 5
  14. Noticed I had to update config.php to:

    $config->paths->libs = $_SERVER['DOCUMENT_ROOT'] . '/mysubdirectory/_phpcls/';
    

    to get the install to complete as i did not install into my root www directory - maybe this can be autodetected?

    Results of testing locally below:

      ["test"]                                    string(16) "cms-basic_visual"
      ["hasUsedCMS"]                              string(4) "0/18"
      ["executiontime"]                           string(12) "6.2528590000"
      ["engine"]                                  string(18) "Apache 2.0 Handler"
      ["php"]                                     string(6) "5.3.13"
      ["os"]                                      string(83) "Windows NT A-PC 6.0 build 6002 (Windows Vista Business Edition Service Pack 2) i586"
      ["imageMagick"]                             string(5) "6.7.6"
      ["imagick module version"]                  string(5) "3.1.2"
      ["imagick classes"]                         string(56) "Imagick, ImagickDraw, ImagickPixel, ImagickPixelIterator"
      ["ImageMagick version"]                     string(34) "ImageMagick 6.7.6-1 2012-03-14 Q16"
      ["ImageMagick copyright"]                   string(46) "Copyright (C) 1999-2012 ImageMagick Studio LLC"
      ["ImageMagick release date"]                string(10) "2012-03-14"
      ["ImageMagick number of supported formats"] string(3) "218"
    

    post-2130-0-36283800-1398712726_thumb.pn

      ["test"]                                    string(19) "cms-with-icc_visual"
      ["hasUsedCMS"]                              string(5) "18/18"
      ["executiontime"]                           string(13) "34.5933610000"
      ["engine"]                                  string(18) "Apache 2.0 Handler"
      ["php"]                                     string(6) "5.3.13"
      ["os"]                                      string(83) "Windows NT A-PC 6.0 build 6002 (Windows Vista Business Edition Service Pack 2) i586"
      ["imageMagick"]                             string(5) "6.7.6"
      ["imagick module version"]                  string(5) "3.1.2"
      ["imagick classes"]                         string(56) "Imagick, ImagickDraw, ImagickPixel, ImagickPixelIterator"
      ["ImageMagick version"]                     string(34) "ImageMagick 6.7.6-1 2012-03-14 Q16"
      ["ImageMagick copyright"]                   string(46) "Copyright (C) 1999-2012 ImageMagick Studio LLC"
      ["ImageMagick release date"]                string(10) "2012-03-14"
      ["ImageMagick number of supported formats"] string(3) "218"
    

    post-2130-0-91963000-1398712729_thumb.pn

    notice some variation between between results - could someone explain what we are looking for here?

    • Like 1
  15. Yes, Adrian is right, it isn't ready yet. Actually there are a few things that need to discussed / solved / changed with the ImageSizer and image handling generally. After that is done, I will implement the same solution into ImagickResizer. Currently it does not recognize settings for upscaling / cropping / etc. But it would be good if you can test it and send a feedback. Or if you can explain how to set up Imagick locally on Mac (if you are on a Mac) in that thread Adrian has linked to.

    Additional to that we are working on the naming scheme. If I remember right you has asked about that too: https://processwire.com/talk/topic/6205-module-pageimage-naming-scheme/

    I have managed to get imagick setup locally (after many hours!) - I will test and post results as soon as i have time (using wampserver php 5.3 on vista 32 bit, had to use image magick 6.7, as the latest 6.8.9 wouldn't play nice - not got time upgrade my wamp right now.

    I have a newer version (php and image magick, 64bit linux) on my server, so will be interesting to compare results.

    I am most interested in the imagick::INTERPOLATE_xxx functions, as GD2 is giving me horrible results for upscaling images more than 200% (looks to be nearest neighbour, not even bilinear).

    I think it is very good to be moving to an image-library agnostic approach to ImageSizer, so that one can just drop in gd2, Imagick, etc.

    Yes I did ask about the naming conventions, what you have written so far looks good - i will see if i can think of any other suggestions for it (add the interpolation method?) also, may be useful to set a different default method for upscaling vs downscaling.

    • Like 2
  16. I have an issue where I want to have an image resized, but have both a cropped and non-cropped version available (of the same size!)

    The code to do this is simple:

    $imagefull = $image->size(320,320,array( 'cropping' => false);
    $imagecropped = $image->size(320,320,array( 'cropping' => true);
    

    However, this only creates ONE variant of the image:

    eg. imagename.320x320.jpg

    So the same image is shown twice in the output page, instead of the two options :(

    Can anyone suggest a clean way of doing this? (ie. not duplicating every base image)

    Is there a way of creating named Image Variations? And do these names go into the filename to guarantee uniqueness?

    eg. $image->addVariation($name,$size,$options) or similar

    Thanks

×
×
  • Create New...