Hey all...
I have a situation where I'd like to allow users to upload an image in a Pagesetter publication through pgForm to be used as a thumbnail... piece of cake right... Thing is, I'd like that image to remain a square with fixed dimensions and suffice it to say that many of my users won't remember to edit the image on their computers before uploading...
There are plenty of scripts that allow the cropping of an image to create a thumbnail... the question is how best to incorporate this into a pagesetter/pgForm plugin?
http://www.hotscripts.com/blog/javascript-image-cropping-scripts/
As always, thanks in advance!
-Julian
--
Burnham Racing
Illinois Cycling Association
Watch
GitHub Core
Show your support for Zikula! Sign up at Github account and watch the Core project!
GitHub Modules
- rgasch created topic »Using PageUtil::addVar() to load script code« 11:48 AM
- michiel responded to »password problem« 10:01 AM
- mazdev responded to »Hide "Register new account" and change template to 3 col« 07:50 AM
- mesteele101 created topic »Zikula 1.3.3 - Site Search 1.5.2 - Unable to turn off plug-ins« 07:48 AM
- mesteele101 responded to »ERR (3): E_USER_ERROR: Smarty error: [in pagesvar:pagesitem2en line XXX]…« 25. May
- mazdev responded to »Pages 2.5.0 and updating - Page not found« 25. May
- mesteele101 responded to »Zikula 1.3.3 - Selecting a category in Pages not working« 25. May
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
Image cropping for Pagesetter?
-
- Rank: Softmore
- Registered: May 22, 2004
- Last visit: Apr 03, 2010
- Posts: 451
-
- Rank: Helper
- Registered: Dec 31, 1969
- Last visit: May 07, 2010
- Posts: 507
I've mentioned this before...
There is a module called Thumbnail. I had a situation exactly like yours and my idea was to create a pnRender plugin where I would pass parameters - image URL, width, height, etc. - and the plugin would send the URL to Thumbnail and return a resized image. I had it working based on a test image at a static URL on the file system. However it wouldn't work with URLs consisting of a query string like Pagesetter uses. The Thumbnail module is based on phpThumb, and that does work with query strings, so there must be something in the Zikula module portion of it that is defeating it.
I didn't have time to debug it. Maybe you do?
-
- Rank: Softmore
- Registered: May 22, 2004
- Last visit: Apr 03, 2010
- Posts: 451
Thanks for the reply bronto-
I have Thumbnail installed but a.) it is a mess b.) there's no documentation so I have no idea how to use it and c.) like you said it doesn't work with Pagesetter URL's.
There is a convoluted way of getting the actual file path for a Pagesetter image using Smarty from within the publication...
Code
<!--[assign var=picture value=http://www.YOUR SITE.com/uploads/`$tid`x`$pid`x`$revision`xphoto.dat]-->
That will get the most recent revision of the image based on Jorn's naming convention: 1x2x1xphoto.dat
tid 1, pid 2, revision 1...
You can get the thumb too:
Code
<!--[assign var=picture value=http://www.YOUR SITE.com/uploads/`$tid`x`$pid`x`$revision`xphoto-tmb.dat]-->
I suppose that then you could simply crop the image to the size you wish using a plugin and/or Smarty... Not the best way of doing it as it strips the user of the ability to resize/crop their photo themselves but so it goes right...
--
Burnham Racing
Illinois Cycling Association -
- Rank: Helper
- Registered: Dec 31, 1969
- Last visit: May 07, 2010
- Posts: 507
Right. I actually tossed what I did and went directly to phpThumb since it does work with Pagesetter URLs, but it's pretty ugly and I'm embarrassed to show it. Does work though...
My own requirements had nothing to do with users being able to determine their own sizes, FWIW.
- Moderated by:
- Support
