Image crop on News Show

Free responsive Joomla 2.5 and 3.x module to present your content with easy and intuitive way.
Rate this topic: Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.
GK User
Tue Jul 12, 2011 3:33 pm
Out of curiosity, why would you ever want an image to stretch? o_O

Isn't the point of the crop functionality so that it would fill a specified height/width without having to stretch the image?
User avatar
Fresh Boarder

GK User
Tue Jul 12, 2011 3:33 pm
Please provide me your website access data to [email protected] - I've to see it, because I cannot belive that it just doesn't work ;)
User avatar
Administrator

GK User
Tue Jul 12, 2011 3:33 pm
I have to hurry to a doctors appoinment but I'll be back.. I hope hehe
User avatar
Platinum Boarder

GK User
Tue Jul 12, 2011 3:35 pm
Sent
User avatar
Platinum Boarder

GK User
Tue Jul 12, 2011 3:46 pm
I think that it can be a problem with the browser cache - I've checked it in the other website and even refresh wasn't work but when I've opened the cached image it was look good.

I recommend to try the CTRL+R combination in the browser window.

BTW anybody with the similar problem?
User avatar
Administrator

GK User
Tue Jul 12, 2011 3:54 pm
Ok, now I've seen that you'd sent me an email. The problem seems to be more trivial as I think - your image isn't 400x600 but 430 x 645 - that's why your settings doesn't work.
User avatar
Administrator

GK User
Tue Jul 12, 2011 4:02 pm
hmm the actual image is 600x400 those sound like the K2 image settings... I'll keep that in mind next time I put my foot in my mouth
User avatar
Platinum Boarder

GK User
Tue Jul 12, 2011 6:47 pm
The best way is checking original image size in the webbrowser, because 600x400 isn't equal to the real image size which is get by the script.
User avatar
Administrator

GK User
Tue Jul 12, 2011 7:22 pm
back from the doc, and none of these sizes are working

Size on the page / 430:645=10:10:70:10;
Size when clicked and expands / 436:655=10:10:70:10;
Size of the original image that was uploaded that K2 scales down / 900:1,350=10:10:70:10;

I just tried the thumb size too 198:130=10:10:70:10;


not working
User avatar
Platinum Boarder

GK User
Tue Jul 12, 2011 9:28 pm
Size 430x645 is working fine - look at the NSP with ID 133 - btw NSP uses always image which is placed in the article with img tag, so clicked and original image are not correct.
User avatar
Administrator

GK User
Tue Jul 12, 2011 9:29 pm
BTW - please remember about enabling cache image for the NSP modules - because it will consume a lot of CPU % on your page
User avatar
Administrator

GK User
Wed Jul 13, 2011 1:29 am
I've had it like this many times it's just not what I was expecting to be considered to be cropped. I was expecting to only see her head and maybe a bit of chest.. am I wrong or is this what you where talking about at all.
User avatar
Platinum Boarder

GK User
Mon Jul 18, 2011 9:06 am
I just install the last version to test cropping, and I agree to say that's don't do that I'm expected...

For example, you want that all your images do 200x100.
If the original image do 300x100, there is a crop of the image, to fill the 200x100 space.

For example, for now I have that :

Capture dcran 2011-01-22 15.22.36.png


With the crop fonction in GK4, I can delete the white space around the image, but there is no "zoom" on the image to fill the space.


I use also the module "Aidanews" and it's works a lot better ! Just a option to check : use cropping or not, you put the desired dimension, and that's all, it automatically fill the space you defined.

I understand that's for now, it's a "beta", and developpers works hard, but I just want to say that for now the crop function don't do that's I'm (and the others users I think) expected.

Thanks to the developpers, I hope you'll find a solution :)
User avatar
Junior Boarder

GK User
Mon Jul 18, 2011 9:43 am
Hi

Did you try to disable "Keep aspect ratio" on?
That's why you have that blank spaces.

Cheers
User avatar
Platinum Boarder

GK User
Mon Jul 18, 2011 10:56 am
Yes, when I put "Keep ratio" to ON, the blank space disappear, but the image is not really cropped...

Example, with "Keep ratio" OFF :

off.PNG



And with "Keep ratio" ON :

on.PNG



When the option is ON, the blank space disappear, but the image space I defined is not filled...


It's exactly the same problem as mongo2006 ;)

Thanks ;)
User avatar
Junior Boarder

GK User
Mon Jul 18, 2011 11:11 am
We have to clarify one thing - the images are cropped before resize and the cropped part is used as a source image for resize operation.
User avatar
Administrator

GK User
Mon Jul 18, 2011 11:22 am
So, besides remove the white border, your "crop" function is useless ?

I respect your work ;) But I try to understand
User avatar
Junior Boarder

GK User
Mon Jul 18, 2011 11:32 am
It is usefull but you have to understand how it works - firstly you crop and then resize the image, not crop and resize in the same time.
User avatar
Administrator

GK User
Mon Jul 18, 2011 11:47 am
Ok, but concretely, how I can do if I have some images, with size x,y,z,...etc (I don't have to know the size), and I want to fill a 200x100 area, without any white border.

If it's not possible, I think users don't really be interested...
User avatar
Junior Boarder

GK User
Mon Jul 18, 2011 12:17 pm
Now you said about the situation which is a basic problem for cropping images in NSP - that's why we have prepared three levels of image selection:

1) suffixes _noscale, _cropped
2) Image cropping based on image size and CSS class
3) General image cropping based in percentage rules.

If you suggest that image cropping based on situation where user crop original image without resize after it is necessary then I can add some "no scale after crop" option in the module - then the cropping process will be really complicated to explain ;)
User avatar
Administrator

GK User
Mon Jul 18, 2011 5:00 pm
Thanks for your awnser.

I'm french, so to be honnest, it's really hard to explain what I want to do.

But, I think I want the same thing that the others users.

Again, without discuss about technical detail : Concretely, I have that :

off.PNG


How, I can do, to have that automatically (without put the size of the original image, just put the size of desired image) :

off.jpg


I know, it's ugly, it's just for example.
I just want that the crop function zoom on the image, to fill the entire space I defined.
User avatar
Junior Boarder

GK User
Mon Jul 18, 2011 5:46 pm
then the cropping process will be really complicated to explain ;)


Lol I dont thimk it can get any more complicated that it is right now, I'm just sitting back waiting on the 1.6-1.7-1.8 versions and the documentation. As I said I see where your going with the module, it's so flexible and that leaves the door open for more creativity but it's just missing the basic function of just zooming and cropping.. no-matter what image size.[/quote]
User avatar
Platinum Boarder

GK User
Mon Jul 18, 2011 6:34 pm
@jujusous3 - sorry but you have to specify the basic image in this case. It is impossible to cut only images with specific dimensions without creating specific rules for cropping.

@mongo2006 - I hope that 1.6+ version of the module will be available in July. I've to prepare also support for K2 in this version ;)
User avatar
Administrator

GK User
Mon Jul 18, 2011 6:47 pm
Thanks, but so how the module "Aidanews" is doing to crop image automatically ?

I really like GK4, but the crop and zoom function is really missing...
User avatar
Junior Boarder

GK User
Tue Jul 19, 2011 12:07 am
@dziudek Yeh I was just talking to Seichinha about feeling sorry for the coder that had to add support for the new K2. Lol didn't realize it would be you.. I'll make the coffee for you.
User avatar
Platinum Boarder

GK User
Mon Jul 25, 2011 12:34 pm
In fact, even if I know the size of the original image, your crop function is not really interesting... Because it just cut a specified part (in px or %) of the image, whatever the image...

Again, Without zooming function, the crop is almost totally useless for the users...

I found some zoom (center zoom) and crop simple script, I'm going to try to adapt them to GK4, but it's certainly more difficult that I imagine...

Anyway, if I were you, I would remove the crop function of the new GK4 function list

Thanks again ;)
User avatar
Junior Boarder

GK User
Mon Jul 25, 2011 12:42 pm
@jujusous3 - for you it can be useless but in a lot of cases it is really necessary. The module and content used in the module is really complex so we cannot find the universal way in the image cropping. In general you can easy implement zooming function with existing cropping engine - just crop X pixels/% of the image from each side - then your image will be zoomed.
User avatar
Administrator

GK User
Mon Jul 25, 2011 12:58 pm
I know it's really complex, but I don't understand why it's impossible to zoom and crop for each image...

Somewhere in the script, you have the original K2 image no ? So using a zoom and crop script using this image is not possible ?

Excuse me to insist, but did you look on the "Aidanews for K2" module ? There is also a version for joomla article. In both case, there is a simple auto crop and zomming function. I use this module to display my last featured news, so whatever the image, the module take it and give me a plain [height]x[width] image.

I know, I'm stubborn :)
User avatar
Junior Boarder

GK User
Mon Jul 25, 2011 1:17 pm
If you need an auto crop functionality then you can use thumbnails generating with no stretch and keep aspect ratio settings - it exists since 2.3.* versions ;)
User avatar
Administrator

GK User
Mon Jul 25, 2011 1:21 pm
"Auto crop and zooming function".

Your function in "auto crop" doesn't have a real effect, it just remove the white stripes around the image, but it's not that I (and almost all of users) want ;)

In the module Aidanews, there is only one file with all the script function in there, so it's more simple than news show pro it's true, bit I'm sure it's possible...
User avatar
Junior Boarder

GK User
Mon Jul 25, 2011 2:10 pm
I'm wrong or with that modified file gk.thumbs.php (including my modification) it's works ?

Try to add a new image, the image is zommed and cropped.

But with my old image, already cached, it seems don't work.

After line 203 I add :

Code: Select all
$source_img = @imagecreatefromjpeg($file); //Create a copy of our image for our thumbnails...         
$new_w = $img_w;
$new_h = $img_h;

echo $new_w.",sdfsdfsdf";

$orig_w = $imageSourceWidth;
$orig_h = $imageSourceHeight;



$w_ratio = ($new_w / $orig_w);
$h_ratio = ($new_h / $orig_h);

if ($orig_w > $orig_h ) {//landscape
   $crop_w = round($orig_w * $h_ratio);
   $crop_h = $new_h;
   $src_x = ceil( ( $orig_w - $orig_h ) / 2 );
   $src_y = 0;
} elseif ($orig_w < $orig_h ) {//portrait
   $crop_h = round($orig_h * $w_ratio);
   $crop_w = $new_w;
   $src_x = 0;
   $src_y = ceil( ( $orig_h - $orig_w ) / 2 );
} else {//square
   $crop_w = $new_w;
   $crop_h = $new_h;
   $src_x = 0;
   $src_y = 0;
}
$dest_img = imagecreatetruecolor($new_w,$new_h);


Then, at the end of function, I change to that :

Code: Select all
// copy image   
               imagecopyresampled($dest_img, $source_img, 0 , 0 , $src_x, $src_y, $crop_w, $crop_h, $orig_w, $orig_h);
               // save image depends from MIME type   
               if($imageData['mime'] == 'image/jpeg' || $imageData['mime'] == 'image/pjpeg' || $imageData['mime'] == 'image/jpg') imagejpeg($dest_img,$cache_dir.$filename, $config['img_quality']);
               elseif($imageData['mime'] == 'image/gif') imagegif($dest_img, $cache_dir.$filename);
               else imagepng($dest_img, $cache_dir.$filename);
               // result


Try it ;)


[attachment]gk.thumbs.php[/attachment]
User avatar
Junior Boarder

GK User
Mon Jul 25, 2011 2:35 pm
Now you said about mechanism which cause that the image is adjusted to show center of the image with cropping left/right or top/bottom sides, but naming it "zooming" isn't in my opinion correct ;) In general it is a diffrent type of thumbnail creation and we can implement it as an another type of thumbnail creation. I didn't implement this type because in my opinion user hasn't control over thumbnail creation - this mechanism can cut some important parts of the image. But if you need this - OK. We'll implement it when we'll release a NSP for J!1.6+ with support for K2.

To avoid misunderstanding: you set thumbnail size to 160x120 and you have an image 400x600 - in this case module will crop the top and bottom parts of the image (160:120 = 1.3(3) so we crop (600 - 400 * 1.3(3)) / 2 ~ 33 pixels area height at bottom and top. And the we scale this image (now it's size is 400x534) to our thumbnail size. Of course the same method is used when image is widher than higher. I'm right? It is what do you need :> Please confirm ;)
User avatar
Administrator

GK User
Mon Jul 25, 2011 2:43 pm
Yes it's exactly what I need, you can have an other example here with this timthumb script :

http://www.darrenhoyt.com/demo/timthumb/

I know it could crop some important part of the image, but I think it's normal when we crop and "zoom".

I was sure that I was not clear at begin, now you know that I want, and I think that's a lot of users want... (see the beginning of the topic).

Only one problem : I have Joomla 1.5, and I can't change to 1.6 (a lot of component and module I have are not compatible), can you just send me a "beta" version of the current version of GK4 with just that function ?
User avatar
Junior Boarder

GK User
Mon Jul 25, 2011 2:46 pm
Don't worry about the version of Joomla! - firstly I'll implement it in 1.5 version and after that I'll add this function to version for J!1.6+. But as I wrote earlier - we have to release NSP GK4 2.0 for J!1.6 and after that we'll release NSP GK4 3.1 with described features.
User avatar
Administrator

GK User
Mon Jul 25, 2011 2:47 pm
Ok :/ And could you give me an approximative release date ? Beacause I need it before the end of august...

If it's too late, I'll try to do it myself...
User avatar
Junior Boarder

GK User
Mon Jul 25, 2011 3:58 pm
it will be around a half of august or earlier ;)
User avatar
Administrator

GK User
Wed Aug 10, 2011 11:57 pm
As I promised: https://www.gavick.com/support/updates. ... ate&id=417

The same features for J!1.7 version of the module will be probably released tommorow ;)
User avatar
Administrator

GK User
Thu Aug 11, 2011 4:17 pm
Ok tanks, I just test it on a fresh installation and seems works perfectly with joomla articles (I'll test it with K2 on the real website next week because I'm in holidays for now :) , so I've not access to the concerned website ).

I would also ask you a second thing :

I have a problem with the "Portal mode, vertical scroller" :

I display news with GK4 like this :


off.PNG



I turned on the "Auto Animation" to scroll automatically.

But when the articles are marching, sometimes some part of the image or of the text is missing. I try to change the vertical scroller height, it's change something but still have some missing part sometimes :/

For example, sometimes the scroll stop at the middle of the first article, and after it's ok, it scroll to begin of second article, next to the begin of the third article....

How works the scroll, how the module know that it have to stop the scroll when we click on the down arrow ?

Thanks ;)
User avatar
Junior Boarder

GK User
Thu Aug 11, 2011 4:20 pm
In general you have to adjust the size of the module and articles to get full articles in first view. So if the module height is 400px and you want to show in view 4 articles - you have to adjust the article size to ~100px.
User avatar
Administrator

GK User
Thu Aug 11, 2011 4:31 pm
Yes, I believed that, but like I said, sometimes it's pretty weird :

For example :

I have 4 articles of each 100px , so when I load the page I have this :

off.PNG


So, I have the first article at the top.

Next, I click on the down arrow, and instead of having the second article at the top, I have the middle of the first article (so that's scroll down to ~50px).

But, where it gets really weird, it's that when I click again on the down arrow, I have the second article at the top. And after that I can click on the down arrox I see the third article...etc at the topc without problem.

It's just the first scroll who don't work well.
I think it's due to the image margin I have around my thumbnail...
User avatar
Junior Boarder


cron