Jump to content
horst

Croppable Image 3

Recommended Posts

No this is not intended. The original image never is changed in PW, at least 99%.

The original uploaded image never is touched and should be in high quality (best 100%). Also, my opinion, it never should be outputed to the frontend. It is the source or master for all variations needed in a site.

To be short, your suggestion can't work at least, as you can specify multiple crop settings, and how should they all be able to update the original image?

But you can and should  call every defined crop variation by its name everywhere you like it. Also you can call every other variation derived from Pageimage, incl. the original image.

Does that make sense for you?

  • Like 1

Share this post


Link to post
Share on other sites

Hi Horst,

I totally understand the concept and process. What I dont under however is that after installing the module the first image I cropped the cropped image was visable in the backend under "homepage afbeelding" as being the sole image to be used in the front-end. The cropped overwrote the uploaded image. Of course the orginal image was still available (in the folder structure).  No problem, but just wanted to let you know that I had two seperate behaviour using the plugin. 

I'll try this evening to replicate the first behaviour. 

  • Like 1

Share this post


Link to post
Share on other sites

@DL7 no i think you may be confused about the standard cropping built into the core.

this module allows you to define various crops and you have to call those by name in the api output code. It does not replace or affect the original image at all.

  • Like 2

Share this post


Link to post
Share on other sites

Hi Cacrura,

 

Perhaps I did the first image indeed via the natice cropped function. My apologies for the confusing.

  • Like 1

Share this post


Link to post
Share on other sites

@horst thanks for your great module.

Today i installed your module via module panel by class name and changed my image field with croppableimage field and i setted a size (full-width,1425,434) for this field. After click this size from images field i have below errors on opened modal box, i can see image and preview image.

Notice: Undefined property: stdClass::$manualSelectionDisabled in /Users/user/Sites/site-folder/site/modules/CroppableImage3/ProcessCroppableImage3/ProcessCroppableImage3.module on line 47

Notice: Undefined property: stdClass::$useImageEngineDefaults in /Users/user/Sites/site-folder/site/modules/CroppableImage3/ProcessCroppableImage3/ProcessCroppableImage3.module on line 48

Notice: Undefined property: stdClass::$manualSelectionDisabled in /Users/user/Sites/site-folder/site/modules/CroppableImage3/ProcessCroppableImage3/ProcessCroppableImage3.module on line 120

I am using ProcessWire 3.0.36 version, I made fresh module installation.

 

Ekran Resmi 2016-10-11 16.56.39.png

Share this post


Link to post
Share on other sites

@horst also can you check this error :

I can't use croppable image 3 module with custom upload names module together. 

Share this post


Link to post
Share on other sites
On 11.10.2016 at 3:50 PM, ukyo said:

@horst thanks for your great module.

Today i installed your module via module panel by class name and changed my image field with croppableimage field and i setted a size (full-width,1425,434) for this field. After click this size from images field i have below errors on opened modal box, i can see image and preview image.

Notice: Undefined property: stdClass::$manualSelectionDisabled in /Users/user/Sites/site-folder/site/modules/CroppableImage3/ProcessCroppableImage3/ProcessCroppableImage3.module on line 47

Notice: Undefined property: stdClass::$useImageEngineDefaults in /Users/user/Sites/site-folder/site/modules/CroppableImage3/ProcessCroppableImage3/ProcessCroppableImage3.module on line 48

Notice: Undefined property: stdClass::$manualSelectionDisabled in /Users/user/Sites/site-folder/site/modules/CroppableImage3/ProcessCroppableImage3/ProcessCroppableImage3.module on line 120

I am using ProcessWire 3.0.36 version, I made fresh module installation.

 

Ekran Resmi 2016-10-11 16.56.39.png

 

On a side note: You cannot use - in your names, because - is the devider for suffixes in image variation names. Please change full-width to fullwidth or fullWidth!

But back to your issue: I wasn't able to recreate it. What exactly have you done to install it? Passing in the class name here: Admin > Modules [ NEW ] -> ModuleClassName

Which classname have you passed?

Share this post


Link to post
Share on other sites

@horst I used class name from this module page : http://modules.processwire.com/modules/croppable-image3/. Also yesterday i downloaded the module files directly from github repo.

I corrected suffix, renamed it "fullwidth" deleted old created files, result not changed (have error).

I applied these :

if(property_exists($globalOptions, 'manualSelectionDisabled'))
if(property_exists($globalOptions, 'useImageEngineDefaults'))

to error lines like @adrian advice for my other issue with this module. I don't have error for the moment, but I don't know is this a really solution ? For the moment continue to work just applied quick fixes.

  • Like 1

Share this post


Link to post
Share on other sites

Do you have opened the FieldtypeCroppableImage3 config screen once or never after install?

Share this post


Link to post
Share on other sites

Yes, after installation I opened FieldtypeCroppableImage3 config screen but didn't make any changes on this screen. Do you offer to disable quality selector ?

With this settings i don't have error when i open modal cropper.

Ekran Resmi 2016-10-15 16.37.25.png

Share this post


Link to post
Share on other sites

Maybe the setting is not relevant, but saving it one time before open the cropper modal?

I need to test this.

Share this post


Link to post
Share on other sites

I unchecked checkbox and saved module settings, tested to open crop modal there is no error. Its look like need to go FieldtypeCroppableImage3 settings and click to save button before use module.

Ekran Resmi 2016-10-15 18.13.51.png

 

  • Like 1

Share this post


Link to post
Share on other sites

Hi horst, thank you for your work on this modul. Is there a problem when I use it within a repeater? When I define an image-field like this: slider,1280,480,home_final the slider-croping-button don't appear on the page. If I define it without the template it works.

  • Like 1

Share this post


Link to post
Share on other sites

Ah, I think this is a bug, or at least it is not obvious for the user, how to define the template for a repeater.

If you define a template, it checks if the current page has this template. I believe "home_final" is the template of the page that contains the repeater? The repeater item itself is a page too, but its template isn't "home_final".

As a quick workaround: determine what is the template name of the repeater items and set this, (maybe additionally), into the fields setup.

For example, if I have a repeaterfield named topmenu, I will find its items under Admin -> Repeaters -> topemnu -> ..., and their template is repeater_topmenu

For the long term, i will see, if this can be done by the module behind the scences. But it will take some time that is currently not available for me. :)

Share this post


Link to post
Share on other sites

Hi horst, thank you very much for explaining this. I tried it but it's the same thing. My repeater-field ist named slider_repeater and the corresponding template is also named slider_repeater. Under it there are subpages which are named home like the pagename of the page which contains the slider field.

My line is

slider,1280,573,slider_repeater,home_final

Only if I write it without any of the to template-names the button will be shown on the page home. It doesn't matter if I use only one of the. Only none of them works ;-)

In this project it's not critical. But I think this could be something people are desire for.

Best Regards

Share this post


Link to post
Share on other sites

These subpages named home, etc, didn't they have a template called repeater_slider_repeater ? I'm not totally sure, but to a great extend, that the repeater items always have a template name with prefixed repeater_

  • Like 2

Share this post


Link to post
Share on other sites

Hey there,

This module is great. Just wondering, what's the best way to have the user choose which cropping to use in the frontend? The way I understand the README file, the programmed template decides which cropping to use. But what if the user wants a vertical image for an image, and a panorama for another? 

Thanks for clarifying.

PS: Currently working for architects, so I'm glad there are "serious" labels now too ;-)

Share this post


Link to post
Share on other sites

Hi lenoir,

the designer / developer decides which format is displayed at the frontend, as he embedds the API code for the output into the template files.

For example, if you define two formats (landscape and portrait), the user has the possibility to select the relevant crop section for both formats, but in a regular / simple setup, the output is defined in the template files with $image->getCrop("portrait")->url at places where a portrait image is required.

If you want to give the user the possibility to choose from different formats for one single place, you need a special setup with e.g. pagetable or the ProFields Repeater Matrix wrapped around the image field.

Share this post


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

If you want to give the user the possibility to choose from different formats for one single place, you need a special setup with e.g. pagetable or the ProFields Repeater Matrix wrapped around the image field.

I was also thinking about a repeater. Pagetable would also make sense I guess. Thanks Horst!

I thought there might be a secret weapon I didn't know of :-)

Share this post


Link to post
Share on other sites
On 17.10.2016 at 6:44 PM, horst said:

These subpages named home, etc, didn't they have a template called repeater_slider_repeater ? I'm not totally sure, but to a great extend, that the repeater items always have a template name with prefixed repeater_

Hi Horst,

thank you for the hint. Yes with repeater_slider_repeater it works like a charm.

  • Like 1

Share this post


Link to post
Share on other sites

@lenoir

Maybe, as a simple way, you also can add a select field near to the croppable image field and let the user select which format he want to be displayed on that page on the frontend.

  • Like 2

Share this post


Link to post
Share on other sites

Hi, I am on ProcessWire version 3.x and just installed this module. It works fine on my superuser account but not on any other roles I have made. When I click on a crop size it brings up the site structure as pictured below instead of the image editing screen. I've also included a screencap of the permissions given to the user. Why it works perfectly fine for my superuser any of my other accounts is doing my head in. Have I overlooked something? :( 

 

croppable-screencap1.png

croppable-screencap2.png

croppable-screencap3.png

Share this post


Link to post
Share on other sites

@Matcha The module installs a permission: "croppable-image-3". Have you given that to the roles that should be able to work with it?

Share this post


Link to post
Share on other sites

Hi, I'm using PW 3.0.33 and would like to crop some images. If I publish the page I have always this error:

Error: Exception: Method Pageimage::getCrop does not exist or is not callable in this context (in ../wire/core/Wire.php line 410)

#0 [internal function]: ProcessWire\Wire->___callUnknown('getCrop', Array)
#1 ../wire/core/Wire.php(348): call_user_func_array(Array, Array)
#2 ../wire/core/WireHooks.php(548): ProcessWire\Wire->_callMethod('___callUnknown', Array)
#3 ../wire/core/Wire.php(371): ProcessWire\WireHooks->runHooks(Object(ProcessWire\Pageimage), 'callUnknown', Array)
#4../wire/core/Wire.php(372): ProcessWire\Wire->__call('callUnknown', Array)
#5 ../wire/core/Wire.php(372): ProcessWire\Pageimage->callUnknown('getCrop', Array)
#6../site/templates/home.php(63): ProcessWire\Wire->__call('getCrop', Array)
#7 

template-file:

$bild = $neuigkeit->images->first()->getCrop('news');
$content .= "<figure>
		<img src='{$bild->url}'>
		<figcaption>{$bild->description}</figcaption>
	</figure>";

printscreen.PNGprintscreen2.PNG

Does anybody know why i keep on getting this error?

Thanks for your help.

Share this post


Link to post
Share on other sites

The error says, that you finally have no pageimage object in

$neuigkeit->images->first()

So, at first you need to check / debug what is in $neuigkeit, what is in $neuigkeit->images and if there are images available in the field on the current page.

Your field setup looks good! incl. setup for cropsetting.

Calling it looks good too, but something in your chain isn't what it should be:

$neuigkeiten should be a page (with a template and with fields). Please check this in your code at exactly the point that throws the error:

echo "<pre>\n<hr />";
echo "$neuigkeiten->id \n $neuigkeiten->template->name \n";

// if the above is not id == 0 and has a valid template name, go on and check the fields in that page:
foreach($neuigkeiten->feilds as $f) {
    echo "$f->name \n";
    // if the images field is in, check if it has images available
    if('images' == $f->name) {
        echo "  count: " . count($neuigkeiten->images) . "\n";
    }
}
// if all above is ok, at list the ->first() image should be a pageimage, you can check this too
$testobj = $neuigkeit->images->first();
if(is_object($testobj)) {
    echo $testobj->className() . "\n";
}
echo "\n<hr /></pre>\n";

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Mike Rockett
      Jumplinks for ProcessWire
      Release: 1.5.56
      Composer: rockett/jumplinks
      Jumplinks is an enhanced version of the original ProcessRedirects by Antti Peisa.
      The Process module manages your permanent and temporary redirects (we'll call these "jumplinks" from now on, unless in reference to redirects from another module), useful for when you're migrating over to ProcessWire from another system/platform. Each jumplink supports wildcards, shortening the time needed to create them.
      Unlike similar modules for other platforms, wildcards in Jumplinks are much easier to work with, as Regular Expressions are not fully exposed. Instead, parameters wrapped in curly braces are used - these are described in the documentation.
      Under Development: 2.0, to be powered by FastRoute
      As of version 1.5.0, Jumplinks requires at least ProcessWire 2.6.1 to run.
      View on GitLab
      Download via the Modules Directory
      Read the docs
      Features
      The most prominent features include:
      Basic jumplinks (from one fixed route to another) Parameter-based wildcards with "Smart" equivalents Mapping Collections (for converting ID-based routes to their named-equivalents without the need to create multiple jumplinks) Destination Selectors (for finding and redirecting to pages containing legacy location information) Timed Activation (activate and/or deactivate jumplinks at specific times) 404-Monitor (for creating jumplinks based on 404 hits) Additionally, the following features may come in handy:
      Stale jumplink management Legacy domain support for slow migrations An importer (from CSV or ProcessRedirects) Feedback & Feature Requests
      I’d love to know what you think of this module. Please provide some feedback on the module as a whole, or even regarding smaller things that make it whole. Also, please feel free to submit feature requests and their use-cases.
      Note: Features requested so far have been added to the to-do list, and will be added to 2.0, and not the current dev/master branches.
      Open Source

      Jumplinks is an open-source project, and is free to use. In fact, Jumplinks will always be open-source, and will always remain free to use. Forever. If you would like to support the development of Jumplinks, please consider making a small donation via PayPal.
      Enjoy! :)
    • By BitPoet
      As threatened in Ryan's announcement for 3.0.139, I built a little module for sliding toggles as a replacement for checkboxes. Styling of the input is CSS3 only (with all the usual caveats about older browsers), no JS necessary, and may still be a bit "rough around the edges", so to speak, since I didn't have much time for testing on different devices or brushing things up enough so I'd feel comfortable pushing it to the module directory. But here's the link to the GitHub repo for now:
      InputfieldSlideToggle
      Fieldtype and Inputfield that implements smartphone-style toggles as replacement for checkbox inputs. The visualization is CSS-only, no additional JS necessary.
      Status
      Still very alpha, use with caution!
      Features / Field Settings
      Size
      You can render the toggles in four different sizes: small, medium, large and extra large.
      Off Color
      Currently, "unchecked" toggles can be displayed either in grey (default) or red.
      On Color
      "Checked" toggles can be rendered in one of these colors: blue (default), black, green, grey, orange or red.
      Screenshots

      Some examples with checkbox label


      View all Size and Color Combinations
      Small toggles Medium toggles Big toggles Extra big toggles  









    • By Orkun
      Hi Guys
      I needed to add extended functionalities for the InputfieldDatetime Module (module is from processwire version 2.7.3) because of a Request of Customer.
      So I duplicated the module and placed it under /site/modules/.
      I have added 3 new Settings to the InputfieldDatetime Module.
      1. Day Restriction - Restrict different days based on weekdays selection (e.g. saturday, sunday) - WORKING

       
      2. Time Slots - Define Time slots based on custom Integer Value (max is 60 for 1 hour) - WORKING

       
      3. Time Range Rules per Weekday - Define a minTime and MaxTime per Weekday (e.g. Opening Hours of a Restaurant) - NOT WORKING PROPERLY

       
      The Problem
      Time Slots and Day Restriction working fine so far. But the Time Range Rules per Weekday doesn't work right.
      What should happen is, that when you click on a date, it should update the minTime and maxTime of the Time Select.
      But the change on the select only happens if you select a date 2 times or when you select a date 1 time and then close the datepicker and reopen it again.
      The time select doesn't get change when you select a date 1 time and don't close the picker.
      Here is the whole extended InputfieldDatetime Module.
      The Files that I have changed:
      InputfieldDatetime.module InputfieldDatetime.js jquery-ui-timepicker-addon.js (https://trentrichardson.com/examples/timepicker/) - updated it to the newest version, because minTime and maxTime Option was only available in the new version  
      Thats the Part of the JS that is not working correctly:
      if(datetimerules && datetimerules.length){ options.onSelect = function(date, inst) { var day = $(this).datetimepicker("getDate").getDay(); day = day.toString(); var mintime = $(this).attr('data-weekday'+day+'-mintime'); var maxtime = $(this).attr('data-weekday'+day+'-maxtime'); console.log("weekday: "+day); console.log("minTime: "+mintime); console.log("maxTime: "+maxtime); var optionsAll = $(this).datetimepicker( "option", "all" ); optionsAll.minTime = mintime; optionsAll.maxTime = maxtime; $(this).datetimepicker('destroy'); $(this).datetimepicker(optionsAll); $(this).datetimepicker('refresh'); //$.datepicker._selectDate($(this).attr("id"),date); //$.datepicker._base_getDateDatepicker(); // var inst = $.datepicker._getInst($(this)); // $.datepicker._updateDatepicker(inst); /*$(this).datetimepicker('destroy'); InputfieldDatetimeDatepicker($(this), mintime, maxtime); $(this).datetimepicker('refresh'); */ // $(this).datetimepicker('option', {minTime: mintime, maxTime: maxtime}); } } Can you have a look and find out what the Problem is?
      InputfieldDatetime.zip
       
      Kind Regards
      Orkun
    • By teppo
      This module tracks changes, additions, removals etc. of public (as in "not under admin") pages of your site. Like it's name says, it doesn't attempt to be a version control system or anything like that - just a log of what's happened.
      At the moment it's still a work in progress and will most likely be a victim of many ruthless this-won't-work-let's-try-that-instead cycles, but I believe I've nailed basic functionality well enough to post it here.. so, once again, I'll be happy to hear any comments you folks can provide
      https://modules.processwire.com/modules/process-changelog/
      https://github.com/teppokoivula/ProcessChangelog
      How does it work?
      Exactly like it's (sort of) predecessor, Process Changelog actually consists of two modules: Process Changelog and Process Changelog Hooks. Hooks module exists only to serve main module by hooking into various functions within Pages class, collecting data of performed operations, refining it and keeping up a log of events in it's own custom database table (process_changelog.) Visible part is managed by Process Changelog, which provides users a (relatively) pretty view of the contents of said log table.
      How do you use it?
      When installed this module adds new page called Changelog under Admin > Setup which provides you with a table view of collected data and basic filtering tools See attached screenshots to get a general idea about what that page should look like after a while.
      For detailed installation instructions etc. see README.md.
       


    • By Gadgetto
      Status update links (inside this thread) for SnipWire development will be always posted here:
      2019-08-08
      2019-06-15
      2019-06-02
      2019-05-25
      If you are interested, you can test the current state of development:
      https://github.com/gadgetto/SnipWire
      Please note that the software is not yet intended for use in a production system (alpha version).
      If you like, you can also submit feature requests and suggestions for improvement. I also accept pull requests.
      ---- INITIAL POST FROM 2019-05-25 ----
      I wanted to let you know that I am currently working on a new ProcessWire module that fully integrates the Snipcart Shopping Cart System into ProcessWire. (this is a customer project, so I had to postpone the development of my other module GroupMailer).
      The new module SnipWire offers full integration of the Snipcart Shopping Cart System into ProcessWire.
      Here are some highlights:
      simple setup with (optional) pre-installed templates, product fields, sample products (quasi a complete shop system to get started immediately) store dashboard with all data from the snipcart system (no change to the snipcart dashboard itself required) Integrated REST API for controlling and querying snipcart data webhooks to trigger events from Snipcart (new order, new customer, etc.) multi currency support self-defined/configurable tax rates etc. Development is already well advanced and I plan to release the module in the next 2-3 months.
      I'm not sure yet if this will be a "Pro" module or if it will be made available for free.
      I would be grateful for suggestions and hints!
      (please have a look at the screenshots to get an idea what I'm talking about)
       




×
×
  • Create New...