Image additions
#21
Posted 23 July 2011 - 02:58 AM
#22
Posted 23 July 2011 - 03:34 AM
{
"news_small" => "50,0,70", ([w,h,compr])
"news-big" => "700,0,70",
"portfolio-small" => "50,50",
"portfolio-medium" => "100,100",
"portfolio-big" => "800,0,100"
}
So $image->original would be the uploaded raw picture, while you could use $image->thumb("portfolio-medium") ...
which would be produced on demand. Don't know if it would fit in your concept, but just wanted to throw in my thoughts.
@somartist | modules created | support me, flattr my work flattr.com
#23
Posted 23 July 2011 - 04:39 AM
#24
Posted 23 July 2011 - 04:57 AM
I think the idea of a config setting where you can set options when creating the field could be the way to go.
#25
Posted 23 July 2011 - 06:00 AM
But surely the problem with doing the on the fly is that they're done every page load and affects the user's experience when browsing the site if a thumbnail is to be created on the fly as well? Or am I not understanding this correctly (far more likely
).
Image resizing is done only on first page load, so it affects very little for overall user experience. PW always first checks if there is already required image on right size and resizes only if image is missing. You can actually do very nice resizing already: http://villarental.c...esidio-del-mar/ (new site developed by Ryan).
I have nothing against defining various image sizes. It is pretty much same than one of the ideas that Ryan mentioned in his long reply. Presetting different images, like thumbnail, medium etc... That would require much more work in UI (cropping for each variation? preview?) and also require more coding on field setting (although using JSON would be possible shortcut here). That would be very powerful solution, no doubt. Although I believe that over 90% of sites doesn't require more than one cropping variation of each image (sizes and center cropping are well supported already). If multiple sizes are possible with clear and well working solution, I am all for it.
#26
Posted 23 July 2011 - 06:39 AM
#27
Posted 24 July 2011 - 09:05 AM
$config->myThumbWidth = 150; $config->myThumbHeight = 100;
Then when you need to create a thumbnail, just refer to those:
$thumb = $page->image->size($config->myThumbWidth, $config->myThumbHeight);
This may be a preferable way to do it if you have multiple templates that need to use the same dimensions. That way you aren't specifying the same dimensions in multiple places... though I'm not always that disciplined.
#28
Posted 28 July 2011 - 04:31 AM
Here's a video I made showing how I use textpattern (+ plugin) to create thumbnails. I wasn't sure I got my point across well enough in my post. I hope it makes sense.
Looks like the jCrop site is back up too: http://deepliquid.co...tent/Jcrop.html
Regards
Marty
#29
Posted 28 July 2011 - 08:49 AM
Thanks,
Ryan
#30
Posted 28 July 2011 - 09:09 AM
I can see this as a tool in the administration, to edit pictures in pages... but as a tool to generate thumbnails?
#31
Posted 28 July 2011 - 09:56 AM
But things change when you bring in TinyMCE. In that context, cropping is just as useful as the existing resize functionality already built into it. As a matter of simplicity, we'll probably set it up so that resize+crop are accessible in any context, but a copy of the original image will always be kept behind-the-scenes.
#32
Posted 28 July 2011 - 04:50 PM
All that plugin does is replace the system's internally generated thumbnail with it's own. In textpattern there's an association between the full image and the thumbnail - if it exists. There's what's called an "article image" field that has an image picker (another plugin) which lets him select a thumbnail to go there. The code below (using another plugin) links the thumbnail to the original image.
So my lightbox code looked like this:
<li><a href="<txp:upm_img_full_url />" title="<txp:title />" rel="lightbox"><img src="<txp:upm_img_thumb_url />" alt="<txp:title />"></a></li>
Otherwise the ordinary textpattern tag to display a thumbail would be:
<txp:article_image thumbnail="1" />.
@adamkiss: It's really all about having more control over what part of the image I want to show as a thumbnail. I am looking at this with artists in mind so my opinion might be skewed somewhat.
Regards
Martin
Marty, thanks for making that video and posting. It was helpful to w-tch that, and I think it seems like a great jCrop implementation there. How did the thumbnails go from what you showed in the video into that grid of illustrations? Were they tagged to appear there, or are they somehow placed with a richtext editor?
Thanks,
Ryan
#33
Posted 01 August 2011 - 07:01 PM
Perhaps as an alternative to having manual cropping built in there could be some way to hold the coordinates of the selection. Those coordinates could then be used with phpThumb: http://phpthumb.sour...mo.demo.php#x24
I have no idea if this is even possible. Smarter minds than me could figure this out though.
Regards
Marty
#34
Posted 02 August 2011 - 01:10 AM
For RTE-use I think just any working cropping tool would do, but I am not that interested about that
#35
Posted 02 August 2011 - 05:05 AM
Hmm.. This got me thinking. What we would need for API usage is not cropping, but just to set the point where to center the cropping. So if you have image of person's head, you could click between person's eyes so there wouldn't be any cropped heads.
For RTE-use I think just any working cropping tool would do, but I am not that interested about that
But not all crops are based on squares. How do you allow for designs that require rectangular proportions?
#36
Posted 02 August 2011 - 06:28 AM
<?php $thumb = $page->image->size(200, 100); //width: 200px, height: 100px
#37
Posted 02 August 2011 - 06:46 AM
For now it works fine and on the site I'm building I'm very impressed with it, but with some optional jCrop functionality it would be amazing
Looking back at that, I'm just reiterating what others have said here, but fixed aspect ratio is a good thing to be able to set as well I reckon.
#38
Posted 16 August 2011 - 03:38 AM
Whilst it's useful to be able to drag an image down to size to create a thumbnail, it's a bit fiddly to get it to a precise size each time. There are a few pages where I want to dot pictures throughout an article but want the thumbnails to be consistently the same width.
The solution in another CMS is having two fields where you can enter width and height, and a checkbox that's checked by default that constrains the proportions (see attached image). Can something like this be added easily enough? I think it would just make it a bit easier to use.
#39
Posted 16 August 2011 - 08:40 AM
#40
Posted 19 August 2011 - 05:52 AM
I have a reasonably urgent need for something similar to jCrop in ProcessWire. If anyone is capable of working on this (as a paid gig) please get in touch: martin@smd.net.au
Regards
Martin
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users













