horst

module
Croppable Image 3

167 posts in this topic

Croppable Image 3 (beta)

for PW 3.0.20+

Module Version 1.1.7

Sponsored by http://dreikon.de/, many thanks Timo & Niko!

You can get it in the modules directory!

Please refer to the readme on github for instructions.

 

-------------------------------------------------------------------------

 

Updating from prior versions:

 

Updating from Croppable Image 3 with versions prior to 1.1.7, please do this as a one time step:

In the PW Admin, go to side -> modules -> new, use "install via ClassName" and use CroppableImage3 for the Module Class Name. This will update your existing CroppableImage3 module sub directory, even if it is called a new install. After that, the module will be recogniced by the PW updater module, what makes it a lot easier on further updates.

-------------------------------------------------------------------------

 

For updating from the legacy Thumbnail / CropImage to CroppableImage3 read on here.

 

-------------------------------------------------------------------------

 

Sticking with a PW legacy 2.8.20+ Version (none namespaced)? - I have created a CroppableImage2 snapshot, which you can get from the github repo branch: CroppableImage2 


-------------------------------------------------------------------------

 

Edited by horst
new infos for updating!
20 people like this

Share this post


Link to post
Share on other sites

How the new editor window looks like.

9 people like this

Share this post


Link to post
Share on other sites

This looks great @horst - just one initial request - can we lose the "Wow that looks great" button label and make it simply "Continue" or "Accept" or something similar. And maybe the "Not happy, crop again" link should be a button with "Redo Crop" ?

PS I know these labels are a legacy of the original thumbnails module, but they do sound a little weird to me.

8 people like this

Share this post


Link to post
Share on other sites
15 hours ago, adrian said:

This looks great @horst - just one initial request - can we lose the "Wow that looks great" button label and make it simply "Continue" or "Accept" or something similar. And maybe the "Not happy, crop again" link should be a button with "Redo Crop" ?

PS I know these labels are a legacy of the original thumbnails module, but they do sound a little weird to me.

What have you done Adrian!?!? 

TBH I was surprised that those lived so long. They always made me smile :)

8 people like this

Share this post


Link to post
Share on other sites
8 minutes ago, apeisa said:

What have you done Adrian!?!? 

TBH I was surprised that those lived so long. They always made me smile :)

I was waiting for your response here - sorry about that - no offense intended :)

2 people like this

Share this post


Link to post
Share on other sites

No offense, but oh so many tears. I will get over this. Someday.

3 people like this

Share this post


Link to post
Share on other sites

I'm thinking about to implement a "show historical label texts" module config checkbox. Antti, would this help to get over this a bit faster?

(Some customers really liked that. "Oh, thats so positive! Fine.") :)

 

5 people like this

Share this post


Link to post
Share on other sites

Aren't your module sponsors withdraw seeing this? :)

2 people like this

Share this post


Link to post
Share on other sites

I actually like when software is not so serious. And I think most people do. Or at least it is not stop for success, take a look at MailChimp and Slack for example. 

@horst the legacy labels setting would make my day! 

1 person likes this

Share this post


Link to post
Share on other sites
8 minutes ago, apeisa said:

I actually like when software is not so serious. And I think most people do. Or at least it is not stop for success, take a look at MailChimp and Slack for example. 

@horst the legacy labels setting would make my day! 

Wow - now I feel so boring and serious :)

Seriously (ha ha) though, I think there is a great place for fun elements in software, but I think it's important who it's aimed at and whether they'll see it as fun or just confusing - "you gotta keep it smart people" (dorky TV quote there)!

Getting OT, but why do all phone companies around the world seem to use cute animals in their advertising? I don't see the fun because I can't see the connection - the fun has to be relevant.

3 people like this

Share this post


Link to post
Share on other sites
1 hour ago, adrian said:

Wow - now I feel so boring and serious :)

Yeah, now I'm thinking about to setup a radio or select with something like:

   "I am serious"

   "I like it funny"

   "I'm brave, surprise me"

 

@apeisa: Yes, that was exactly what one customer said to me a month ago: "Oh, thats nice and not so serious. I like it. It is the same way like Mailchimp do."

3 people like this

Share this post


Link to post
Share on other sites
2 hours ago, tpr said:

Aren't your module sponsors withdraw seeing this? :)

Haha, I don't hope so!

Share this post


Link to post
Share on other sites

Version 0.9.12

I added a single centralized translation file. It combines all text strings of all module and dependency files. This way it should be easier or lesser work to translate it. (<- hint @ceberlin, @Manfred62, @yellowled :))

@apeisa: Also the legacy and serious text selection is included. (legacy is default!)

 

 

 

6 people like this

Share this post


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

legacy is default!

boo! hiss!

Just kidding :) I actually don't mind it at all now that the crop again option is a button rather than a text link.

1 person likes this

Share this post


Link to post
Share on other sites

Haha! Yep, and also, if you or your customer are more from the serious side, it is only a selection and a save click to change it. :)

Share this post


Link to post
Share on other sites
Quote

this way it should be easier or lesser work to translate it. (<- hint

Ok, I will take care of the translation to DE tonight...

2 people like this

Share this post


Link to post
Share on other sites

Hi Horst,

it's great to see CoppableImage again in PW3!
For me as Superuser all is fine, but if I login with another role (with right "page-edit-image") the modal crop-window switches to the pagetree-view.

1 person likes this

Share this post


Link to post
Share on other sites

Hmmm after installing the new Version I have a problem:

When clicking on "Wow that looks great / Accept" the modal window does not close anymore. It does not close, when I click on the "X" in the upper right corner either.

Plus, there are a few Javascript errors:

InputfieldCroppableImage3.js:31 Uncaught TypeError: Cannot read property 'width' of undefined

I testet in on my Mac with Chrome and Firefox. Same behaviour in both browsers.

Share this post


Link to post
Share on other sites

Here it is working without errors. Also, the relevant part for that hasn't changed between the last versions.

Maybe browser cache issue, or, if that doesn't help. Delete all files and folders under site/modules/CroppableImage3/ ... and copy a fresh one new Version into it, to make sure to have all the latest versions?

I can switch force and back between the two modal windows multiple times, and I also can close it via the buttons and the X.

13 hours ago, Noboru said:

For me as Superuser all is fine, but if I login with another role (with right "page-edit-image") the modal crop-window switches to the pagetree-view.

I will test this and come back here, when done.

Share this post


Link to post
Share on other sites
13 hours ago, Noboru said:

Hi Horst,

it's great to see CoppableImage again in PW3!
For me as Superuser all is fine, but if I login with another role (with right "page-edit-image") the modal crop-window switches to the pagetree-view.

Same behave here, sorry.

What I encountered in short, is: I get different color for the modal windows title bar (?), and it doesn't open the processPage. So, it is an access issue. I need to investigate further. ...

Share this post


Link to post
Share on other sites

Somehow I had lost the permission settings during the rewrite. Also there were a chance for some interfere with the permission of the older Croppable module.

Now I have fixed it with the update to version 0.9.14

But it will not update / correct itself, :(

To get rid of the bug, everyone who has installed a version lesser than 0.9.14 should follow these manual steps:

  1. copy the module files >= 0.9.14 into site/modules/CroppableImage3/
  2. goto admin > modules > site > ProcessCroppableImage3, open it, select uninstall and uninstall it
  3. now refresh the modules cache
  4. and install the ProcessCroppableImage3
  5. open all your user roles that need edit rights for crop images and add the new " image-crop-3 " permission to them

Ready!

For fresh installs of version 0.9.14+, everything works out of the box.

5 people like this

Share this post


Link to post
Share on other sites

Hello Horst,

I got problems with the crop function. I always get the error message "process returns no content" after clicking the cropping button:

Here are the crop settings of my image field:

Screenshot_13.jpg

As you can see I have added pre-defined crop settings to the image field.

And here you can see what happens if I press the crop button:


5xsM3xVPfB.gif

The modal window always shows that no content will be returned. I have tried to catch an error with Tracy Debugger but not luck.

PW: 3.0.32, User: Superuser, PHP 5.6.25, Server: Apache, Croppable image 3: version 0.9.14

Any idea?

Best regards Jürgen

Share this post


Link to post
Share on other sites

How do you have installed it? Was a previous version there before?

If there is no Process installed, that could be because:

the ProcessImageCroppable3 isn't installed or not installed correct. maybe it misses its admin page?

Have you checked that ProcessCroppableImage3 is installed?

Did you have under Admin > Pages > a page with title "Croppable Images 3", and what is its process and name?

 

1 person likes this

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 Robin S
      First a note about my other modules...
      I have three existing modules that are similar in that they allow restrictions to be placed on repeating inputfields: Limit Repeater, Limit PageTable, Limit Table
      Restrict Repeater Matrix takes a different approach to the module configuration from those other modules. The module settings for Restrict Repeater Matrix are applied in the field settings rather in a module config screen. I think this new approach is better, but it means that it isn't practical to create different settings for different roles via the admin interface. Instead the module has a hookable method, allowing roles to be targeted and other advanced usages to be achieved via a hook. The result is that the module is more flexible.
      I intend to transition my other modules to the same approach over the coming weeks, but because this will result in breaking changes I will be releasing the updated modules under new names ("Restrict Repeater", etc) to avoid users upgrading via the Upgrades module without full awareness of the changes. The old modules will be marked as deprecated.
       
      Restrict Repeater Matrix
      A module for ProcessWire CMS/CMF. Allows restrictions and limits to be placed on Repeater Matrix fields.
      For any matrix type in a Repeater Matrix field you have the option to:
      Prevent drag-sorting of items Prevent cloning of items Prevent toggling of the published state of items Prevent trashing of items Limit the number of items that may be added to the inputfield Please note that restrictions and limits are applied with CSS/JS so should not be considered tamper-proof.
      Usage
      Install the Restrict Repeater Matrix module.
      For each matrix type created in the Repeater Matrix field settings, a "Restrictions" fieldset is added at the bottom of the matrix type settings:

      For newly added matrix types, the settings must be saved first in order for the Restrictions fieldset to appear. Set restrictions for each matrix type as needed. A limit of zero means that no items of that matrix type may be added to the inputfield.
      Setting restrictions via a hook
      Besides setting restrictions in the field settings, you can also apply or modify restrictions by hooking RestrictRepeaterMatrix::checkRestrictions. This allows for more focused restrictions, for example, applying restrictions depending on the template of the page being edited or depending on the role of the user.
      The checkRestrictions() method receives the following arguments:
      $field This Repeater Matrix field $inputfield This Repeater Matrix inputfield $matrix_types An array of matrix types for this field. Each key is the matrix type name and the value is the matrix type integer. $page The page that is open in ProcessPageEdit The method returns a multi-dimensional array of matrix types and restrictions for each of those types. An example of a returned array:

      Example hooks
      Prevent the matrix type "images_block" from being added to "my_matrix_field" in a page with the "basic-page" template:
      $wire->addHookAfter('RestrictRepeaterMatrix::checkRestrictions', function(HookEvent $event) { $field = $event->arguments('field'); $page = $event->arguments('page'); $type_restrictions = $event->return; if($field->name === 'my_matrix_field' && $page->template->name === 'basic-page') { $type_restrictions['images_block']['limit'] = 0; } $event->return = $type_restrictions; });  
      Prevent non-superusers from trashing any Repeater Matrix items in "my_matrix_field":
      $wire->addHookAfter('RestrictRepeaterMatrix::checkRestrictions', function(HookEvent $event) { $field = $event->arguments('field'); $type_restrictions = $event->return; if($field->name === 'my_matrix_field' && !$this->user->isSuperuser()) { foreach($type_restrictions as $key => $value) { $type_restrictions[$key]['notrash'] = true; } } $event->return = $type_restrictions; });  
      https://github.com/Toutouwai/RestrictRepeaterMatrix
    • By bernhard
      Hi,
      just stumbled over a little module that i built for my last project. it helped me to test performance of my rockdatatables module to generate 3000 random json datasets and i want to share it with you. maybe it saves some time for someone.
      https://gitlab.com/baumrock/RockDummyData/
      easy example:
      $rdd = $modules->get('RockDummyData'); for($i=0; $i<15; $i++) { // this has to be inside the for-loop to always get a new dummy $dummy = $rdd->getDummy(); echo date("d.m.Y H:i:s", $dummy->timestamp) . "<br>"; } more advanced:
      $json = new stdClass(); $json->data = array(); $rdd = $modules->get('RockDummyData'); for($i=0; $i<3000; $i++) { // this has to be inside the for-loop to always get a new dummy $dummy = $rdd->getDummy(); $obj = new stdClass(); $obj->name = $dummy->forename . ' ' . $dummy->surname; $obj->position = $dummy->job; $obj->office = $dummy->city; $obj->color = $dummy->color; $obj->start_date = new stdClass(); $obj->start_date->display = date('d.m.Y',$dummy->timestamp); $obj->start_date->sort = $dummy->timestamp; $obj->salary = rand(0,10000); $json->data[] = $obj; } echo json_encode($json); you have to store your random datasets on your own into the /data folder. there are several services for creating all kinds of random data on the web - if you know one service that allows sharing those datasets let me know and i can include common needed data into the module
    • By AndySh
      Hello!
      I need your assistance please. I purchased the module FormBuilder. Unfortunately, the module discontinued delivering customer submissions to e-mail box specified in the module settings. Direct mailing to the e-mail box works OK. The module settings stays the same and are correct, like "Send e-mail to administrator(s) is checked. The last version of FormBuilder 3.0 has been installed. Please advise how to resolve the issue becase I cannot get orders from customers anymore (((
    • By kixe
      As described in this post (https://processwire.com/talk/topic/8551-custom-urls-for-pages/?p=82742) the option 'Name Format Children' under the tab 'Family' in template settings doesn't work properly and also not as expected. I had a look inside the code and made some changes which are working properly, which offers much more options, more consistency and less code too.

      The result is the following. You have 3 Options for generating name and title, which could be combined in endless variations.
      Name is always derived from title, same like creating pages manually.
      type date: if function detects # character anywhere in the string, conversion will be: deletion of # and string will be used as format parameter for PHP date() function type field: if string is a fieldname of the parent page the value of this field will be used type string: if string doesn't fit to the 2 preceeding it will be taken as it is All parts (separated by comma) will be composed in the order of setting. You can use unlimited numbers of parts

      I made a pull request on github: https://github.com/ryancramerdesign/ProcessWire/pull/831

      Example screenshots

      Setting ...


      will result in


       
    • By kongondo
      FieldtypeRuntimeMarkup and InputfieldRuntimeMarkup
       
      Modules Directory: http://modules.processwire.com/modules/fieldtype-runtime-markup/
      GitHub: https://github.com/kongondo/FieldtypeRuntimeMarkup
       
      This module allows for custom markup to be dynamically (PHP) generated and output within a page's edit screen (in Admin).
       
      The value for the fieldtype is generated at runtime. No data is saved in the database. The accompanying InputfieldRuntimeMarkup is only used to render/display the markup in the page edit screen.
       
      The field's value is accessible from the ProcessWire API in the frontend like any other field, i.e. it has access to $page and $pages.
       
      The module was commissioned/sponsored by @Valan. Although there's certainly other ways to achieve what this module does, it offers a dynamic and flexible alternative to generating your own markup in a page's edit screen whilst also allowing access to that markup in the frontend. Thanks Valan!
       
      Warning/Consideration
      Although access to ProcessWire's Fields' admin pages is only available to Superusers, this Fieldtype will evaluate and run the custom PHP Code entered and saved in the field's settings (Details tab). Utmost care should therefore be taken in making sure your code does not perform any CRUD operations!! (unless of course that's intentional) The value for this fieldtype is generated at runtime and thus no data is stored in the database. This means that you cannot directly query a RuntimeMarkup field from $pages->find(). Usage and API
       
      Backend
      Enter your custom PHP snippet in the Details tab of your field (it is RECOMMENDED though that you use wireRenderFile() instead. See example below). Your code can be as simple or as complicated as you want as long as in the end you return a value that is not an array or an object or anything other than a string/integer.
       
      FieldtypeRuntimeMarkup has access to $page (the current page being edited/viewed) and $pages. 
       
      A very simple example.
      return 'Hello'; Simple example.
      return $page->title; Simple example with markup.
      return '<h2>' . $page->title . '</h2>'; Another simple example with markup.
      $out = '<h1>hello '; $out .= $page->title; $out .= '</h1>'; return $out; A more advanced example.
      $p = $pages->get('/about-us/')->child('sort=random'); return '<p>' . $p->title . '</p>'; An even more complex example.
      $str =''; if($page->name == 'about-us') { $p = $page->children->last(); $str = "<h2><a href='{$p->url}'>{$p->title}</a></h2>"; } else { $str = "<h2><a href='{$page->url}'>{$page->title}</a></h2>"; } return $str; Rather than type your code directly in the Details tab of the field, it is highly recommended that you placed all your code in an external file and call that file using the core wireRenderFile() method. Taking this approach means you will be able to edit your code in your favourite text editor. It also means you will be able to type more text without having to scroll. Editing the file is also easier than editing the field. To use this approach, simply do:
      return wireRenderFile('name-of-file');// file will be in /site/templates/ If using ProcessWire 3.x, you will need to use namespace as follows:
      return ProcessWire\wireRenderFile('name-of-file'); How to access the value of RuntimeMarkup in the frontend (our field is called 'runtime_markup')
       
      Access the field on the current page (just like any other field)
      echo $page->runtime_markup; Access the field on another page
      echo $pages->get('/about-us/')->runtime_markup; Screenshots
       
      Backend
       

       

       
      Frontend