Jump to content
apeisa

Release: Thumbnails

Recommended Posts

Sorry, I am lying, it is NOT working.

I have two image fields right next to each other, and I was trying with the wrong one.

So, whatever I try, it is not uploading images - they are just registering as deleted, or something.

Sorry!

Joss

Share this post


Link to post
Share on other sites

And if you reload the page is there the image ort not?

Have you got a empty new line.. I dont know. It is working fine here now. :-/

Share this post


Link to post
Share on other sites

No, reloading just shows an empty field - and nothing in assets. 

So, it is actually not getting uploaded at all.

I am just going to try and create a new field with just the default setting and see what happens.

Share this post


Link to post
Share on other sites

Okay, update.

Created a new field. Save

Left all settings as default.

Added it to template.

It did not work.

===========

Saved new field - leaving the settings as default.

It now works.

Changed settings.

Still works.

Not sure why I cannot get the other field to work, however. Something odd has happened during set up, I suppose, some combination that I have done.

Share this post


Link to post
Share on other sites

A quick note unrelated to the above.

There is an issue with Twitter Bootstrap (and probably other responsive frameworks) that the max width of 100% messes up Jcrop.

However, this can be solved by adding:

#bd img {
  max-width: none !important;
}
 
To somewhere. :)
 
And it is all better again.

Share this post


Link to post
Share on other sites

Downloaded the latest version from Github. Installed it on PW 2.2.14 (2.3) on a fresh installation running with PHP 5.3 - It works so far until I want to edit the crop area. Click on it just opens the new tab saying 

Unrecognized path

Hope you can come up with a working version for PW 2.3. This module is so useful. 

Share this post


Link to post
Share on other sites

It works already. Have you changed an imagr field to a crop image?

Share this post


Link to post
Share on other sites

Yes. Now I have created a new field (named it again images,deleted the old one?) and the error still occurs.

Share this post


Link to post
Share on other sites

Is it insider a repeater or anything you found out? Have you chance to install on different machine that could help further?

Share this post


Link to post
Share on other sites

Nothing. Just the basic-page template with a field called images or "bilder". 

Activating the Debug mode displays the full error:

 

TemplateFile: Unrecognized path

I've first checked the admin.php in the templates folder - it's there.

Older versions of PW with the module are running on the same server without any problems. Could try to install it on the machine here.

EDIT:

Ok, strange but known behaviour:

I've uninstalled everything and installed it again. Now I'm stuck at the upload with the error as Joss.

EDIT 2:

Works now. Just followed the steps Joss described. 

Share this post


Link to post
Share on other sites

A complete aside:

Just working on a blog profile and I am thoroughly enjoying the plugin! So thanks!

Thought I would just say that.

Joss

  • Like 1

Share this post


Link to post
Share on other sites

I'm running into a small issue with the Thumbnails module where a client is uploading an original image which has the exact dimensions of the configured thumbnail size for the CropImage field... It's a case where the client knows the image dimensions used on the website, and tries to upload an original with the right dimensions (even though he doesn't have to) ...but he doesn't know enough to compress it.  

Strangely, the thumbnail is created as normal (I can use it in my templates), but compression is never applied if the dimensions of the original match the thumbnail dimensions.  So we're ending up with a lot of bloated jpegs slowing down the site.

It works fine, of course, if I click the 'thumbnail' link to custom-crop the image (with the jcrop interface), and just select the whole image as the cropping zone. But I don't want the client to have to do that. Better to just drag the file into the field, save the entry, and let ProcessWire work it's magic ;-).

Can I somehow tweak the module to force the compression of images in this case? Any pointers would really be appreciated...

Thanks for your time,

-Brent

Share this post


Link to post
Share on other sites

Hi bcartier,

I think this is currently only possible with a little hack.

I took a look at the source of Thumbnails and if I'm right, you need to uncomment the if on line 91 here:

https://github.com/apeisa/Thumbnails/blob/master/FieldtypeCropImage.module#L91

//if ($this->w != $sizer->getWidth() || $this->h != $sizer->getHeight()) {
  $this->_copyAndResize($img, $imgPath);
//}
  • Like 1

Share this post


Link to post
Share on other sites

Thanks Wanze!

That's really helpful. The ProcessWire community comes through again!  :-)

  • Like 1

Share this post


Link to post
Share on other sites

This would be a nice preference to have on the module settings Antti.

Share this post


Link to post
Share on other sites

This would be a nice preference to have on the module settings Antti.

Maybe. Not sure. I hate settings :)

  • Like 1

Share this post


Link to post
Share on other sites

Bringing Wanze's small change into the module works for me  ;-)

No settings!

Share this post


Link to post
Share on other sites

I have a strange thing happening here.

I ported a PW 229 site with this working plugin from a development server to another server and when I upload a new image it shows just the same image in one size for all the thumbnail versions.

When I click on one image to crop, it shows the extra window and then I can select the crop section allright, I then click on crop and go and get the page that says:

wow that looks great, but no image shows up, when I click on wow that looks great I return to the image and when I now hover over the just cropped image, it shows an empty little hover screen where before it showed the uncropped image, if I then click save article I get the following error:

small_xxxx.jpg is an unsupported image type and then the whole page is not accessible anymore.

When I go into site/assets/files/files/1023 it shows small_xxxx.jpg with a filesize of 0, once I delete that I can access the page again.

When I check the log file it says:

2013-03-02 21:37:55    guest    http://www.xxx.xxx/    Error    Exception: small_xxxx.jpg is not a recogized image (in /xxx/xxx/xxx/xxx.xxx/public_html/wire/core/ImageSizer.php line 92)

I then upgraded to pw 2.2.15, same story.

I also tested on a new site (PW 2.2.15) on this same server and after uploading I went into the site/assets/files/1081 dir and see

featured_3145-xl.jpg     173.068 size

homefeatured_3145-xl.jpg     same 173.068 size

page_3145-xl.jpg  same 173.068 size

reference_3145-xl.jpg  same 173.068 size

So the module does replicate the files upon upload, but does not resize.

And after crop it changes the images size to 0 and prevents the page from showing in the front end AND the backend, I can only access the page in the backend again after deleting the 0 size image

Both sites now on PW 2.3 (=2.2.15?), but I took one site back to 2.2.9 stable and same issue.

Only difference between servers is OS, dev server was ubuntu (I think) new server is FreeBSD.

Share this post


Link to post
Share on other sites

Hi, - sorry, I might not of great help in this, but it maybe that this behave not only target the module but also the ImageSize-core:

you should post or reference in this Topic too:

http://processwire.com/talk/topic/1448-proper-image-type-checking-instead-of-extensions-for-imagesizer/

The new site on the same server is pw 2.2.15 too?

Share this post


Link to post
Share on other sites

Hello Horst,

Thanks for posting in the other thread, yes I think it might have something to do with the resizer, but I am not familiar enough with how it all works under the hood so to speak.

The new site is on 2.2.15 as well, I reverted one to 2.2.9 and that did not make any difference either.

I wonder if anyone can say what dependencies the cropping feature needs for php extensions etc, I am almost inclined to believe it has to do with that.

The plugin itself seems to work partly, as in:

- after upload it makes different named versions of exact the same sized image, no cropping applied whatsoever

- when forced to do a manual crop it ends up making a new 0 sized version of the image, which freezes the page in the back end and the front end.

thanks

Share this post


Link to post
Share on other sites

OK, so I see that ImageSizer.php needs gd2, and on my server phpinfo says:

gd GD Support enabled GD Version bundled (2.0.34 compatible) FreeType Support enabled FreeType Linkage with freetype FreeType Version 2.4.11 GIF Read Support enabled GIF Create Support enabled JPG Support enabled PNG Support enabled WBMP Support enabled XBM Support enabled

So it looks liek I have the extension I need for this to work, yet it does not work, any ideas?

Share this post


Link to post
Share on other sites

One step further...

I uploaded a png file and now the module works as it should, it correctly creates all the right sized images.

So it seems the trouble lies with jpg files.

Any ideas?

Share this post


Link to post
Share on other sites

OK fixed!

I had to reinstall a few things on my server, so it had nothing to do with this plugin.

Just for anybody's information, I am on a freebsd server, using directadmin and had to go to:

/usr/ports/graphics/jpeg and make deinstall, then I had to make reinstall

then I went back into :/usr/local/directadmin/custombuild and run ./build php to rebuild php with all options, I chose to reinstall all options to get php compiled with GD supprt for jpeg

This module is truly awesome!

 

  • Like 1

Share this post


Link to post
Share on other sites

I've upgraded my 2.2.9 site to 2.2.15 and I can't get cropping to work at all - not with any image type. There's been no changes to my server that I know of.

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 MoritzLost
      This is a new module that provides a simple solution to clearing all your cache layers at once, and an extensible interface to perform various cache-related actions.
      The simple motivation behind this module was that I was tired of manually clearing caches in several places after deploying a change on a live site. The basic purpose of this module is a simple Clear all caches link in the Setup menu which clears out all caches, no matter where they hide. You can customize what exactly the module does through it's configuration menu:
      Expire or delete all cache entries in the database, or selectively clear caches by namespace ($cache API) Clear the the template render cache. Clear out specific folders inside your site's cache directory (/site/assets/cache) Refresh version strings for static assets to bust client-side browser caches (this requires some setup, see the full documentation for details). This is the basic function of the module. However, you can also add different cache management action through the API and execute them through the module's interface. For this advanced usage, the module provides:
      An interface to see all available cache actions and execute them. A system log and logging output on the module page to see verify what the module is doing. A CacheControlTools class with utility functions to clear out different caches. An API to add cache actions, execute them programmatically and even modify the default action. Permission management, allowing you granular control over which user roles can execute which actions. The complete documentation can be found in the module's README.
      Beta release
      Note that I consider this a Beta release. Since the module is relatively aggressive in deleting some caches, I would advise you to install in on a test environment before using it on a live site.
      Let me know if you're getting any errors, have trouble using the module or if you have suggestions for improvement!
      In particular, can someone let me know if this module causes any problems with the ProCache module? I don't own or use it, so I can't check. As far as I can tell, ProCache uses a folder inside the cache directory to cache static pages, so my module should be able to clear the ProCache site cache as well, I'd appreciate it if someone can test that for me.
      Future plans
      If there is some interest in this, I plan to expand this to a more general cache management solution. I particular, I would like to add additional cache actions. Some ideas that came to mind:
      Warming up the template render cache for publicly accessible pages. Removing all active user sessions. Let me know if you have more suggestions!
      Links
      https://github.com/MoritzLost/ProcessCacheControl ProcessCacheControl in the Module directory

    • 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="optin" data-type="text/javascript" data-category="statistics" data-src="/path/to/your/statistic/script.js"></script> <script type="optin" data-type="text/javascript" data-category="marketing" data-src="/path/to/your/mareketing/script.js"></script> <script type="optin" data-type="text/javascript" data-category="external_media" data-src="/path/to/your/external-media/script.js"></script> <script type="optin" 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: https://github.com/blaueQuelle/privacywire/tree/master
      Download: https://github.com/blaueQuelle/privacywire/archive/master.zip
      I would love to hear your feedback 🙂
      Edit: Updated URLs to master tree of git repo
       
    • By David Karich
      Admin Page Tree Multiple Sorting
      ClassName: ProcessPageListMultipleSorting
      Extend the ordinary sort of children of a template in the admin page tree with multiple properties. For each template, you can define your own rule. Write each template (template-name) in a row, followed by a colon and then the additional field names for sorting.
      Example: All children of the template "blog" to be sorted in descending order according to the date of creation, then descending by modification date, and then by title. Type:
      blog: -created, -modified, title  Installation
      Copy the files for this module to /site/modules/ProcessPageListMultipleSorting/ In admin: Modules > Check for new modules. Install Module "Admin Page Tree Multible Sorting". Alternative in ProcessWire 2.4+
      Login to ProcessWire backend and go to Modules Click tab "New" and enter Module Class Name: "ProcessPageListMultipleSorting" Click "Download and Install"   Compatibility   I have currently tested the module only under PW 2.6+, but think that it works on older versions too. Maybe someone can give a feedback.     Download   PW-Repo: http://modules.processwire.com/modules/process-page-list-multiple-sorting/ GitHub: https://github.com/FlipZoomMedia/Processwire-ProcessPageListMultipleSorting     I hope someone can use the module. Have fun and best regards, David
    • By dimitrios
      Hello,
      this module can publish content of a Processwire page on a Facebook page, triggered by saving the Processwire page.
      To set it up, configure the module with a Facebook app ID, secret and a Page ID. Following is additional configuration on Facebook for developers:
      Minimum Required Facebook App configuration:
      on Settings -> Basics, provide the App Domains, provide the Site URL, on Settings -> Advanced, set the API version (has been tested up to v3.3), add Product: Facebook Login, on Facebook Login -> Settings, set Client OAuth Login: Yes, set Web OAuth Login: Yes, set Enforce HTTPS: Yes, add "https://www.example.com/processwire/page/" to field Valid OAuth Redirect URIs. This module is configurable as follows:
      Templates: posts can take place only for pages with the defined templates. On/Off switch: specify a checkbox field that will not allow the post if checked. Specify a message and/or an image for the post.
      Usage
      edit the desired PW page and save; it will post right after the initial Facebook log in and permission granting. After that, an access token is kept.
       
      Download
      PW module directory: http://modules.processwire.com/modules/auto-fb-post/ Github: https://github.com/kastrind/AutoFbPost   Note: Facebook SDK for PHP is utilized.


×
×
  • Create New...