Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2010-12-14 23:55:36

radneck
Plugin Author
Registered: 2005-07-03
Posts: 109

Re: esq_autoimageresize - Automatically resize uploaded images

gfdesign wrote:

Yes, I create the thumbnail after it uploaded, but I´d like it creates by its self.

This is possible, with a little rewriting of the plugin logic. I’m not planning on releasing a new version any time soon however. Have a look at the smd_thumbnail though, it may be more like what you’re looking for.

I´d like too your plugin works with “lam_image_uploader” because the most of my clients upload the images by this way.

Unfortunately the lam_image_uploader plugin doesn’t use any of the standard callbacks that were introduced with TXP 4.2.0. These callbacks are requred by esq_autoimageresize to know when an image is upload, so as to resize it.

As such, images uploaded with lam_image_uploader won’t be resized straight away. If you are using per-category resize dimensions, uploading a photo with lam_image_uploader and then going to the images tab and adding the image to a certain category will resize it. This probably doesn’t help you much though.

Good luck with it.

Last edited by radneck (2011-03-04 05:55:01)

Offline

#14 2011-03-26 19:38:52

kevinpotts
Member
From: Ghost Coast
Registered: 2004-12-07
Posts: 370

Re: esq_autoimageresize - Automatically resize uploaded images

I know you’re not planning on releasing a new version, but I am also having a problem with thumbnails, in that with the plugin installed, Textpattern outright refuses to generate a thumbnail for an image that’s been resized. No errors, everything else works as expected. (Running 4.3.0)

Also, is it possible to edit the plugin’s code to set a default size? Let’s say I have 40 image categories; all but two need to resize an image to the same dimensions and the remaining to need their own specific dimensions. Can I set a variable in the code to say “start with 500 pixels wide for every category, unless I specify something different”.

Thanks — it’s a great plugin.

Last edited by kevinpotts (2011-03-26 19:39:41)


Kevin
(graphicpush)

Offline

#15 2011-03-28 02:27:06

radneck
Plugin Author
Registered: 2005-07-03
Posts: 109

Re: esq_autoimageresize - Automatically resize uploaded images

** Updated **

See post below.

Last edited by radneck (2011-03-29 12:02:55)

Offline

#16 2011-03-29 12:00:50

radneck
Plugin Author
Registered: 2005-07-03
Posts: 109

Re: esq_autoimageresize - Automatically resize uploaded images

Righto Kev,

Firstly, I originally misunderstood the thumbnail issue when it was first stated, so apologies for that. I never used thumbnails so I never noticed the problem myself.
The problem stemmed from the fact that this plugin uses the txp thumbnail class to resize the images – the process went a little like this:

  1. Create a thumbnail of uploaded image, using the dimensions we want the resized image to be
  2. Copy the newly generated thumbnail over as the main image
  3. Delete the thumbnail
    Obviously during that process, any existing thumbnail gets wiped. It didn’t actually affect the automatic thumbnail generation that txp uses, but because the callbacks used by this plugin are processed after the thumbnails are generated, they just got wiped over, making it look like the automatic thumbnail generation failed silently.

I’ve updated the plugin to fix this issue. However I’m pretty busy at the moment, so I haven’t had a chance to test as extensively as I normally like to. Please report any bugs you encounter.

Your other request was pretty trivial to implement, you can find the code here (dump straight into the edit plugin window, preferably after upgrading to 1.03). Just edit the variables noted (lines 11 to 13). I left a sample width and height in there. Crop can either be 0 (false) or 1 (true).

Just for clarities sake:
For everyone (not just Kevin): this plugin has been updated.

Last edited by radneck (2015-11-04 07:40:44)

Offline

#17 2011-06-05 17:00:07

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 687
Website Mastodon

Re: esq_autoimageresize - Automatically resize uploaded images

Just to state it:
WORKS WELL WITH TXP 4.4.0.
Thanx a bunch!


A hole turned upside down is a dome, when there’s also gravity.

Offline

#18 2011-07-15 14:37:05

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 687
Website Mastodon

Re: esq_autoimageresize - Automatically resize uploaded images

Questions:

1. Is there a way to activate GD’s image resampling and control over GD’s quality setting within this plugin?
(I doubt it, as i couldn’t find anything in txpimage.php as well…)
2. Would it be possible to add the option of entering a default category automatically to the resized image, just to get around the bug in conjunction with lam_image_uploader ? Basically this coudl look like a radio button enabling “automatic category assign” [dropdown list of image categories].
3. I am using this in conjunction with bot_image_upload instead now. In irregular intervals, though, the resizing doesn’t take place. I have to save the image and reupload it then. I’ll have to nail down the exact conditions with a proper test case, in case you’d need this.

Thank you very much in advance.

Last edited by jayrope (2011-07-15 14:45:54)


A hole turned upside down is a dome, when there’s also gravity.

Offline

#19 2011-07-19 07:51:09

radneck
Plugin Author
Registered: 2005-07-03
Posts: 109

Re: esq_autoimageresize - Automatically resize uploaded images

Sorry for the late response. I’ve replied in-line below.

jayrope wrote:

1. Is there a way to activate GD’s image resampling and control over GD’s quality setting within this plugin?
(I doubt it, as i couldn’t find anything in txpimage.php as well…)

No sorry, I don’t think so. I haven’t really used GD much – this is the first time actually – so the extent of my knowledge of the extension is limited to what I could get from the txp_image.php.

2. Would it be possible to add the option of entering a default category automatically to the resized image, just to get around the bug in conjunction with lam_image_uploader ? Basically this coudl look like a radio button enabling “automatic category assign” [dropdown list of image categories].

I’d say yes, this should definitely be possible – but you may have to break out ied_plugin_composer and have a crack at coding that in yourself, as I currently don’t have time to work on this plugin I’m sorry.

3. I am using this in conjunction with bot_image_upload instead now. In irregular intervals, though, the resizing doesn’t take place. I have to save the image and reupload it then. I’ll have to nail down the exact conditions with a proper test case, in case you’d need this.

This sounds unusual, and if you’re able to provide a test-case I can reproduce I’ll try and get it fixed. I’m not sure if this is completely on the wrong path, but I have seen issues with some plugins on the write tab when the tab is loaded as the default tab (i.e. URL is /textpattern/ or /textpattern/index.php) instead of through clicking on the actual tab (i.e. URL is /textpattern/?event=article).

Last edited by radneck (2015-11-04 07:39:44)

Offline

#20 2011-07-30 14:27:16

photonomad
Member
Registered: 2005-09-10
Posts: 290
Website

Re: esq_autoimageresize - Automatically resize uploaded images

I am using TXP 4.4.1 and just installed esq_autoimageresize. If I try to upload an image that is larger than the resize dimensions that are specified in the plugin options, the image does not upload. Instead, textpattern displays “No file was specified” in the upper left area of the page.

I am wondering if this is an error due to the image-related security upgrades in TXP 4.4.1?

Offline

#21 2011-08-02 13:26:30

radneck
Plugin Author
Registered: 2005-07-03
Posts: 109

Re: esq_autoimageresize - Automatically resize uploaded images

How large was the image (in MB, not pixels)? It may be that the file was bigger than what the PHP settings allow.
I doubt it has to do with the upgrades. Can you upload a normal sized image?

Offline

#22 2012-07-18 18:12:30

photonomad
Member
Registered: 2005-09-10
Posts: 290
Website

Re: esq_autoimageresize - Automatically resize uploaded images

It has been long time since my previous post about esq_autoimgeresize. The “no file was specified” problem seems to have worked itself out. However, I am now revisiting the plugin for use on two different sites. Both sites have a nice big 8MB upload limit. Big images are uploading fine, however they do not consistently resize with the plugin. I’ve tried a bunch of tests to see if I can find the culprit: I’ve turned all plugins off and had the same issues. Sometimes I update the plugin settings and the resize will work, other times this doesn’t have any effect. Sometimes I empty my browser cache or I turn plugins back on or change the plugin load order. Nothing seems to get it to work consitently. I’ll upload 4 big horizontal images in a row and all will resize, then I upload a big vertical image and it doesn’t resize and subsequent uploads (regardless of orientation) will fail to resize too. Any thoughts?

Last edited by photonomad (2012-07-18 21:55:34)

Offline

#23 2012-07-22 19:55:26

nabrown78
Member
From: Northampton, MA, USA
Registered: 2006-10-04
Posts: 294
Website

Re: esq_autoimageresize - Automatically resize uploaded images

This plugin looks perfect for a particular client’s site, but I’ve installed it and it doesn’t seem to be working. Some site details:

Textpattern version: 4.4.1 (r3575)
Last Update: 2012-07-11 02:31:03/2012-07-11 02:29:54
upload_tmp_dir: /localservices/phpupload
Temporary directory path: /services/webpages/j/a/jandonley.net/public/textpattern/tmp
Site URL: www.jandonley.net
PHP version: 5.2.17
Register globals: 1
GD Image Library: bundled (2.0.34 compatible); supported formats: GIF, JPG, PNG.

I don’t see any errors anywhere, and images upload fine; they simply do not resize. I am not using the per-category resizing, but even using that images aren’t resized.

EDIT: I was just experimenting around and at some point, I did see this error at the bottom of the images tab:

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 1600 bytes) in /services6/webpages/util/j/a/jandonley.site.aplus.net/public/textpattern/lib/class.thumb.php on line 213

But now I can not reproduce it. The images I’ve been using a largish, but under 1MB

Last edited by nabrown78 (2012-07-22 20:03:29)

Offline

#24 2012-07-24 06:24:33

radneck
Plugin Author
Registered: 2005-07-03
Posts: 109

Re: esq_autoimageresize - Automatically resize uploaded images

Sorry for the late replay guys.

Both of these issues are without a doubt related to PHP memory, especially as Nora you saw it first hand.

If you have a large enough upload limit, which seems likely as the image does land, then it could only be the PHP memory.

The script will require varying amounts of memory, depending on how big the image is as well as how severe the resize is. I haven’t been able to work out a particular forumla, but Nora 33554432 bytes is only 32 MB, not a huge amount of ram.

Try setting memory_limit = 128M in your php.ini file, and seeing how you go.

As for browser side settings (clearing cache etc), these will have no affect, its purely what’s going on serverside. Other plugins shouldn’t have an affect either, unless they’re tapped into the same image upload/save hooks that esq_autoimageresize is.

Let me know how you go.

Offline

Board footer

Powered by FluxBB