Jump to content
horst

Croppable Image 3

Recommended Posts

the current version is 1.1.15

please update and try again. We have fixed this already. :)

 

  • Thanks 1

Share this post


Link to post
Share on other sites

Sorry, it is the Process module that in version 1.1.10, while the Wrapper module 1.1.15.

The version I installed is up to date already.

Share this post


Link to post
Share on other sites

I used simple var_dump to debug a bit as I don't know why tracy debug is not working(Please tell me if you have any idea :)). I found that the issue is positioned at ProcessCroppableImage3.module line 234 and 235. isset($this->input->post->quality) and isset($this->input->post->sharpening) are returning false. Thus, the value is returned as options['quality'] instead of user input intval($this->input->post->quality).

// when I choose 60 quality
var_dump($this->input->post->quality, isset($this->input->post->quality), is_numeric($this->input->post->quality), 0<intval($this->input->post->quality), 101>intval($this->input->post->quality));
  
// return : string(2) "60" bool(false) bool(true) bool(true) bool(true)

 

Share this post


Link to post
Share on other sites

Updated to latest version PW and CroppableImage3 but old code from templates doesn't work anymore are there code examples to call CroppableImage3 in templates. Thanks!

if($page->mosaik_title_1) { echo "
<div class='three columns'>
<a href='{$page->mosaik_url_1}/'>
<span class='m1'>{$page->mosaik_title_1}</span>
<img src='{$page->mosaic_photo_1->eq(0)->getThumb('thumbnail')}' alt='{$page->mosaic_photo_1->description}' /></a></div>";}

and

foreach($page->children as $child)
            echo "
                <div class='cat1 cat5'>
                <div class='port-item-container'>
                    <div class='port-box'>
                            <a rel='bookmark' title='{$child->title}' href='{$child->url}'>
                            <img src='{$child->overviewimg->eq(0)->getThumb('thumbnail')}' alt='$child->title'>
                            </a>
                    </div>
                    <div class='port-item-title'>
                        <h6>{$child->title}</h6>
                        <span>{$child->overviewtxt}...<a href='{$child->url}'> Lees verder »</a></span>
                    </div>
                </div>
                </div>
                ";

Share this post


Link to post
Share on other sites

changing...

<img src='{$child->overviewimg->eq(0)->getThumb('thumbnail')}' alt='$child->title'>

to...

<img src='{$child->overviewimg->eq(0)->getCrop('thumbnail')}' alt='$child->title'>

did not work...

...and give error:

Exception: There is no crop setting for the template 'home' called 'thumbnail' (in /domains/gemsbok.nl/DEFAULT/fresh/site/modules/CroppableImage3/FieldtypeCroppableImage3/FieldtypeCroppableImage3.module line 209)

And have set the crop setting to square,160,160

Share this post


Link to post
Share on other sites

@Oca2 - please try to avoid double posting and if you do, please follow up on both so people don't try to help you when you've already been helped.

Thanks!

Cheers,
Adrian

Share this post


Link to post
Share on other sites
37 minutes ago, adrian said:

@Oca2 - please try to avoid double posting and if you do, please follow up on both so people don't try to help you when you've already been helped.

Thanks!

Cheers,
Adrian

Ok will follow up this time and next time avoid double post :)

 

  • Like 1

Share this post


Link to post
Share on other sites

No more errors :)

But...

I don't want to go through the update process renaming all images files... to complicated so I will manually update the images...

...But if I select new images from admin they are still not visible on the front-end???

Share this post


Link to post
Share on other sites

Check file in attachment, that should rename all your existing files to the new [please do read instructions carefully, make sure you have a back-up]
BTW, I didn't write it, but I have used it a few times, with success.

also, new syntax is + ->url
So, I guess in your case:

<img src='{$child->overviewimg->eq(0)->getCrop('thumbnail')->url}' alt='$child->title'>

Hope this helps....

cropupdate.php

 

Quote

Exception: There is no crop setting for the template 'home' called 'thumbnail' (in /domains/gemsbok.nl/DEFAULT/fresh/site/modules/CroppableImage3/FieldtypeCroppableImage3/FieldtypeCroppableImage3.module line 209)

This is because, when changing from 'CropImage' to 'CroppableImage3', you actually have to re-enter the Crop Settings, in your case 'thumbnail'

  • Like 1

Share this post


Link to post
Share on other sites
21 hours ago, Oca2 said:

No more errors :)

But...

I don't want to go through the update process renaming all images files... to complicated so I will manually update the images...

...But if I select new images from admin they are still not visible on the front-end???

Look here, there is complete upgrade procedure with help:

 

Share this post


Link to post
Share on other sites
8 minutes ago, horst said:
22 hours ago, Oca2 said:

 

Look here, there is complete upgrade procedure with help:

Thanks for chiming in @horst - I have already linked to that: 

This is the problem with multiple threads for the same issue, :) but I think @Oca2 has the message on that now :)

  • Like 1

Share this post


Link to post
Share on other sites
On 1/26/2018 at 1:36 AM, adrian said:

Thanks for chiming in @horst - I have already linked to that: 

This is the problem with multiple threads for the same issue, :) but I think @Oca2 has the message on that now :)

I think it is to complicated... would be nice if this was fixed by a default update... not by hand going through source codes 2 much time and possibility's 2 break stuff.

Share this post


Link to post
Share on other sites
Just now, Oca2 said:

I think it is to complicated... would be nice if this was fixed by a default update... not by hand going through source codes 2 much time and possibility's 2 break stuff.

Remember that these modules were built by different developers - CroppbaleImage3 is not an upgrade to the Thumbnails module. The Thumbnails module was abandoned and @horst was kind enough to build this one and also put together a script to make the migration as easy as possible. 

The conversion from Thumbnails to CroppableImage is the only issue I have had with migrating any of my sites from PW 2 to 3 - I think that is pretty incredible for a major version upgrade.

I am not meaning to sound dismissive, I understand it's not a simple migration, but I don't think it should be expected to be automatic in this scenario - I hope you understand.

  • Like 3

Share this post


Link to post
Share on other sites
26 minutes ago, adrian said:

Remember that these modules were built by different developers - CroppbaleImage3 is not an upgrade to the Thumbnails module. The Thumbnails module was abandoned and @horst was kind enough to build this one and also put together a script to make the migration as easy as possible. 

The conversion from Thumbnails to CroppableImage is the only issue I have had with migrating any of my sites from PW 2 to 3 - I think that is pretty incredible for a major version upgrade.

I am not meaning to sound dismissive, I understand it's not a simple migration, but I don't think it should be expected to be automatic in this scenario - I hope you understand.

Yes I understand 101% now!

I thought it was a core plugin...

Can't wait to have the code up and running I'm on 50% updating... 50% works :)

This works :)

<img src='{$page->mosaic_photo_2->eq(0)->getCrop('thumbnail')->url}' alt='{$page->mosaic_photo_2->description}' /></a></div>";}

This not :(

<img src='{$child->overviewimg->eq(0)->getCrop('thumbnail')->url}' alt='$child->title'>

 

Edited by Oca2
  • Like 1

Share this post


Link to post
Share on other sites

One hundred and one % working now, Thanks ProcessWire Crew for the help & info!

Oca2

  • Like 1

Share this post


Link to post
Share on other sites
Just now, Oca2 said:

One hundred and one % working now, Thanks ProcessWire Crew for the help & info!

Oca2

It was missing the setting "thumbnail,160,160"

Share this post


Link to post
Share on other sites

Any chance we can get the addition of a method to check if there has been a crop defined for the image (over the default)? And possibly some way in the admin to reset the crops?

By all means if I get a chance I will look at doing this myself and submitting a pull request.

 

Thansk @horst

Share this post


Link to post
Share on other sites

I'm not sure if it is worth the (for me ATM, not available) time to add new functionality to this module as we got the "focus point thingy" now in the core. When this get a zoom functionality too, it is much much easier to use for authors and devs too.

https://processwire.com/blog/posts/pw-3.0.89/

@adamspruijt

 

Share this post


Link to post
Share on other sites

@horst Agreed, looking at the way the zoom feature will work on the focus cropping I think I will be able to migrate. 

  • Like 1

Share this post


Link to post
Share on other sites

Is it safe to migrate from Croppable Image 3 to the New Core Image Focus/Zoom on a production site? Has anyone done that? If yes what are the steps to do it properly to avoid messing things up?

Share this post


Link to post
Share on other sites

There are no such steps. The cropable image and the focus point are completly different things and can be used side by side. 

If you want to drop cai and use focus point, you have to switch the api code in your templates. Before you completely remove cai calls, you may change them to a call to remove variations. But others then that isn't necessary. 

Share this post


Link to post
Share on other sites
3 minutes ago, horst said:

There are no such steps. The cropable image and the focus point are completly different things and can be used side by side. 

If you want to drop cai and use focus point, you have to switch the api code in your templates. Before you completely remove cai calls, you may change them to a call to remove variations. But others then that isn't necessary. 

I haven't used the Focus/Zoom yet but I thought that they actually do the same job as Croppable Image 3...

Share this post


Link to post
Share on other sites

@horst, sorry to bother you with this (and sorry if it's a dumb question in the first place), but what's the current state of this module like?

I'm in desperate need of "pixel perfect" pre-defined crops, and while the focus and zoom feature is really cool, it solves a different problem entirely. Reading some of the posts here I'm wondering if this module is still something I should go with, or do I just need to wait and hope that @ryan decides to add pre-defined crop areas to the core one day?

Thanks! 🙂

  • Like 1

Share this post


Link to post
Share on other sites

@teppo, This module is ready to use with the current stable and dev versions of PW (3.0.99+). I know that many users (and me too) actively uses it in many sites. It is also simple to use in conjunction with MarkupSourceSet.

So, I think I will not add new features to it, but I will maintain the compatibility of it with future PW versions!

Some time ago, it becomes compatible with new UIKit-AdminTheme. Here is a screen:

screen_cai3_01.thumb.jpg.789512e64e54f920915cdfd021079ab6.jpg

 

  • Like 4
  • Thanks 1

Share this post


Link to post
Share on other sites

Hi @horst, is it possible to have a hookable method that for creation of variation image? I would like to hook it to upload the newly created variation image to somewhere else.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By joshua
      This module is (yet another) way for implementing a cookie management solution.
      Of course there are several other possibilities:
      - https://processwire.com/talk/topic/22920-klaro-cookie-consent-manager/
      - https://github.com/webmanufaktur/CookieManagementBanner
      - https://github.com/johannesdachsel/cookiemonster
      - https://www.oiljs.org/
      - ... and so on ...
      In this module you can configure which kind of cookie categories you want to manage:

      You can also enable the support for respecting the Do-Not-Track (DNT) header to don't annoy users, who already decided for all their browsing experience.
      Currently there are four possible cookie groups:
      - Necessary (always enabled)
      - Statistics
      - Marketing
      - External Media
      All groups can be renamed, so feel free to use other cookie group names. I just haven't found a way to implement a "repeater like" field as configurable module field ...
      When you want to load specific scripts ( like Google Analytics, Google Maps, ...) only after the user's content to this specific category of cookies, just use the following script syntax:
      <script type="text/plain" data-type="text/javascript" data-category="statistics" data-src="/path/to/your/statistic/script.js"></script> <script type="text/plain" data-type="text/javascript" data-category="marketing" data-src="/path/to/your/mareketing/script.js"></script> <script type="text/plain" data-type="text/javascript" data-category="external_media" data-src="/path/to/your/external-media/script.js"></script> <script type="text/plain" data-type="text/javascript" data-category="marketing">console.log("Inline scripts are also working!");</script> The type has to be "optin" to get recognized by PrivacyWire, the data-attributes are giving hints, how the script shall be loaded, if the data-category is within the cookie consents of the user. These scripts are loaded asynchronously after the user made the decision.
      If you want to give the users the possibility to change their consent, you can use the following Textformatter:
      [[privacywire-choose-cookies]] It's planned to add also other Textformatters to opt-out of specific cookie groups or delete the whole consent cookie.
      You can also add a custom link to output the banner again with a link / button with following class:
      <a href="#" class="privacywire-show-options">Show Cookie Options</a> <button class="privacywire-show-options">Show Cookie Options</button> This module is still in development, but we already use it on several production websites.
      You find it here: PrivacyWire Git Repo
      Download as .zip
      I would love to hear your feedback 🙂
      CHANGELOG
      0.1.1 Debugging: fixed error during uninstall 0.1.0 Added new detection of async scripts for W3C Validation 0.0.6 CSS-Debugging for hiding unused buttons, added ProCache support for the JavaScript tag 0.0.5 Multi-language support included completely (also in TextFormatter). Added possibility to async load other assets (e.g. <img type="optin" data-category="marketing" data-src="https://via.placeholder.com/300x300">) 0.0.4 Added possibility to add an imprint link to the banner 0.0.3 Multi-language support for module config (still in development) 0.0.2 First release 0.0.1 Early development
    • By bernhard
      --- Please use RockFinder3 ---
    • By MoritzLost
      Cacheable Placeholders
      This module allows you to have pieces of dynamic content inside cached output. This aims to solve the common problem of having a mostly cacheable site, but with pieces of dynamic output here and there.  Consider this simple example, where you want to output a custom greeting to the current user:
      <h1>Good morning, <?= ucfirst($user->name) ?></h1> This snippet means you can't use the template cache (at least for logged-in users), because each user has a different name. Even if 99% of your output is static, you can only cache the pieces that you know won't include this personal greeting. A more common example would be CSRF tokens for HTML forms - those need to be unique by definition, so you can't cache the form wholesale.
      This module solves this problem by introducing cacheable placeholders - small placeholder tokens that get replaced during every request. The replacement is done inside a Page::render hook so it runs during every request, even if the response is served from the template cache. So you can use something like this:
      <h1>Good morning, {{{greeting}}}</h1> Replacement tokens are defined with a callback function that produces the appropriate output and added to the module through a simple hook:
      // site/ready.php wire()->addHookAfter('CachePlaceholders::getTokens', function (HookEvent $e) { $tokens = $e->return; $tokens['greeting'] = [ 'callback' => function (array $tokenData) { return ucfirst(wire('user')->name); } ]; $e->return = $tokens; }); Tokens can also include parameters that are parsed and passed to the callback function. There are more fully annotated examples and step-by-step instructions in the README on Github!
      Features
      A simple and fast token parser that calls the appropriate callback and runs automatically. Tokens may include multiple named or positional parameters, as well as multi-value parameters. A manual mode that allows you to replace tokens in custom pieces of cached content (useful if you're using the $cache API). Some built-in tokens for common use-cases: CSRF-Tokens, replacing values from superglobals and producing random hexadecimal strings. The token format is completely customizable, all delimiters can be changed to avoid collisions with existing tag parsers or template languages. Links
      Github Repository & documentation Module directory (pending approval) If you are interested in learning more, the README is very extensive, with more usage examples, code samples and usage instructions!
    • By Craig
      I've been using Fathom Analytics for a while now and on a growing number of sites, so thought it was about time there was a PW module for it.
      WayFathomAnalytics
      WayFathomAnalytics is a group of modules which will allow you to view your Fathom Analytics dashboard in the PW admin panel and (optionally) automatically add and configure the tracking code on front-end pages.
      Links
      GitHub Readme & documentation Download Zip Modules directory Module settings screenshot What is Fathom Analytics?
      Fathom Analytics is a simple, privacy-focused website analytics tool for bloggers and businesses.

      Stop scrolling through pages of reports and collecting gobs of personal data about your visitors, both of which you probably don't need. Fathom is a simple and private website analytics platform that lets you focus on what's important: your business.
      Privacy focused Fast-loading dashboards, all data is on a single screen Easy to get what you need, no training required Unlimited email reports Private or public dashboard sharing Cookie notices not required (it doesn't use cookies or collect personal data) Displays: top content, top referrers, top goals and more
    • By daniels
      This is a lightweight alternative to other newsletter & newsletter-subscription modules.
      You can find the Module in the Modules directory and on Github
      It can subscribe, update, unsubscribe & delete a user in a list in Mailchimp with MailChimp API 3.0. It does not provide any forms or validation, so you can feel free to use your own. To protect your users, it does not save any user data in logs or sends them to an admin.
      This module fits your needs if you...
      ...use Mailchimp as your newsletter / email-automation tool ...want to let users subscribe to your newsletter on your website ...want to use your own form, validation and messages (with or without the wire forms) ...don't want any personal user data saved in any way in your ProcessWire environment (cf. EU data regulation terms) ...like to subscribe, update, unsubscribe or delete users to/from different lists ...like the Mailchimp UI for creating / sending / reviewing email campaigns *I have only tested it with PHP 7.x so far, so use on owners risk
      EDIT:
      Since 0.0.4, instructions and changelog can be found in the README only. You can find it here  🙂
      If you have questions or like to contribute, just post a reply or create an issue or pr on github, thanks!
×
×
  • Create New...