Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

2 Pages12>
image crop
meodemsao
#1 Posted : Thursday, October 13, 2011 4:30:17 AM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 5/24/2011(UTC)
Posts: 32
i has viewed in source code has jcrop but i can't find this using anywhere??
i think if has its good feature
meodemsao
#2 Posted : Thursday, October 13, 2011 4:36:53 AM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 5/24/2011(UTC)
Posts: 32
And if i create a news account then role as editor
this account can't access to select file in editor(tinymce)
jifeng
#3 Posted : Thursday, October 13, 2011 5:39:38 AM(UTC)
Rank: Administration
Groups: Administrators, Registered

Joined: 9/3/2009(UTC)
Posts: 1,552
Location: Xiamen China
meodemsao;5057 wrote:
And if i create a news account then role as editor
this account can't access to select file in editor(tinymce)


I think it is a bug had fixed in 3.0.5, can you try it in 3.0.5?
Regards,

Jifeng Huang

Kooboo Team

Microsoft ASP.NET MVP
jifeng
#4 Posted : Thursday, October 13, 2011 5:41:58 AM(UTC)
Rank: Administration
Groups: Administrators, Registered

Joined: 9/3/2009(UTC)
Posts: 1,552
Location: Xiamen China
meodemsao;5056 wrote:
i has viewed in source code has jcrop but i can't find this using anywhere??
i think if has its good feature


The source code is: Kooboo.CMS.Content/Kooboo.CMS.Content/EventBus/Content/ContentImageCropSubscriber.cs
Regards,

Jifeng Huang

Kooboo Team

Microsoft ASP.NET MVP
1 user thanked jifeng for this useful post.
Hrvoje_86 on 11/17/2011(UTC)
meodemsao
#5 Posted : Thursday, October 13, 2011 6:09:47 AM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 5/24/2011(UTC)
Posts: 32
jifeng;5059 wrote:
meodemsao;5056 wrote:
i has viewed in source code has jcrop but i can't find this using anywhere??
i think if has its good feature


The source code is: Kooboo.CMS.Content/Kooboo.CMS.Content/EventBus/Content/ContentImageCropSubscriber.cs


Thanks,but i need to known where this feature using in the admin :P
jifeng
#6 Posted : Friday, October 14, 2011 1:11:34 AM(UTC)
Rank: Administration
Groups: Administrators, Registered

Joined: 9/3/2009(UTC)
Posts: 1,552
Location: Xiamen China
It is a control type, you can use it when you edit the content type.
Regards,

Jifeng Huang

Kooboo Team

Microsoft ASP.NET MVP
meodemsao
#7 Posted : Friday, October 14, 2011 3:24:21 AM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 5/24/2011(UTC)
Posts: 32
jifeng;5066 wrote:
It is a control type, you can use it when you edit the content type.

i try use this but its not success
jifeng
#8 Posted : Friday, October 14, 2011 1:48:48 PM(UTC)
Rank: Administration
Groups: Administrators, Registered

Joined: 9/3/2009(UTC)
Posts: 1,552
Location: Xiamen China
What happened?
Regards,

Jifeng Huang

Kooboo Team

Microsoft ASP.NET MVP
meodemsao
#9 Posted : Friday, October 14, 2011 1:57:51 PM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 5/24/2011(UTC)
Posts: 32
jifeng;5068 wrote:
What happened?


after i upload image and crop form not show anything


meodemsao
#11 Posted : Sunday, October 16, 2011 12:04:55 PM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 5/24/2011(UTC)
Posts: 32
crop image work on firefox but not work on chrome
jifeng
#12 Posted : Monday, October 17, 2011 1:23:30 AM(UTC)
Rank: Administration
Groups: Administrators, Registered

Joined: 9/3/2009(UTC)
Posts: 1,552
Location: Xiamen China
OK, I will check it on chrome, but we always test on chrome first. I will try to see what happened.
Regards,

Jifeng Huang

Kooboo Team

Microsoft ASP.NET MVP
Hrvoje_86
#13 Posted : Friday, October 28, 2011 8:28:35 PM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 1/28/2011(UTC)
Posts: 154
Location: Croatia
I have this problem also it is not chromes fault.
It happens to me when filename has empty spaces.
Hrvoje_86
#16 Posted : Friday, October 28, 2011 9:18:09 PM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 1/28/2011(UTC)
Posts: 154
Location: Croatia
Can images be cropped from code with kooboo3 api like in kooboo 2?
jifeng
#14 Posted : Monday, October 31, 2011 3:01:52 AM(UTC)
Rank: Administration
Groups: Administrators, Registered

Joined: 9/3/2009(UTC)
Posts: 1,552
Location: Xiamen China
Hrvoje_86;5203 wrote:
I have this problem also it is not chromes fault.
It happens to me when filename has empty spaces.

Ok, thanks.
Regards,

Jifeng Huang

Kooboo Team

Microsoft ASP.NET MVP
jifeng
#17 Posted : Monday, October 31, 2011 3:07:43 AM(UTC)
Rank: Administration
Groups: Administrators, Registered

Joined: 9/3/2009(UTC)
Posts: 1,552
Location: Xiamen China
Hrvoje_86;5207 wrote:
Can images be cropped from code with kooboo3 api like in kooboo 2?

yes, have the api.

public ActionResult ResizeImage(string url, int width, int height, bool? preserverAspectRatio, int? quality)

Here is the url api:

@Url.FrontUrl().ResizeImageUrl(imagePath, width, height)
Regards,

Jifeng Huang

Kooboo Team

Microsoft ASP.NET MVP
Hrvoje_86
#18 Posted : Monday, October 31, 2011 8:08:22 AM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 1/28/2011(UTC)
Posts: 154
Location: Croatia
It resizes fine but does not crop the image.
If i set ResizeImage(url, 300,100, true, 90)
I will not get a cropped image 300x100 like in kooboo 2.

Kooboo 2 would crop resize the width to 300 then resize the height to keep aspect ration then if the image was higher it would cut of the extra height in top and bottom.
That was a smart way to do it becouse the image space would be filled and you could have any dimensions you want.

In kooboo 3 i would get the image resized by height to 100 and then the width would be reduced.
This is not cropping.
Hrvoje_86
#15 Posted : Thursday, November 17, 2011 5:55:23 PM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 1/28/2011(UTC)
Posts: 154
Location: Croatia
jifeng;5220 wrote:
Hrvoje_86;5203 wrote:
I have this problem also it is not chromes fault.
It happens to me when filename has empty spaces.

Ok, thanks.


The problem is in Kooboo.CMS.Web
Areas/Contents/Controllers/TextContentController.cs

[HttpPost]
public ActionResult TempFile()

Code:

// after removing filename after guuid it works
var fileUrl = Kooboo.Web.Url.UrlUtility.Combine(tempPath, Guid.NewGuid().ToString()+".jpg");
jifeng
#19 Posted : Friday, November 18, 2011 8:46:18 AM(UTC)
Rank: Administration
Groups: Administrators, Registered

Joined: 9/3/2009(UTC)
Posts: 1,552
Location: Xiamen China
I will check it right now.
Regards,

Jifeng Huang

Kooboo Team

Microsoft ASP.NET MVP
jifeng
#20 Posted : Friday, November 18, 2011 9:48:43 AM(UTC)
Rank: Administration
Groups: Administrators, Registered

Joined: 9/3/2009(UTC)
Posts: 1,552
Location: Xiamen China
Fixed it.http://kooboo.codeplex.com/SourceControl/changeset/changes/690d8fe4398f
Regards,

Jifeng Huang

Kooboo Team

Microsoft ASP.NET MVP
1 user thanked jifeng for this useful post.
Hrvoje_86 on 11/18/2011(UTC)
Hrvoje_86
#10 Posted : Saturday, November 19, 2011 12:47:40 AM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 1/28/2011(UTC)
Posts: 154
Location: Croatia
meodemsao;5069 wrote:
jifeng;5068 wrote:
What happened?


after i upload image and crop form not show anything



You are right there is also a problem in chrome and safari but not with all versions.

I didn't have any problem with chrome until today i updated it to the latest version.

Theer is a blog post about this problem http://blog.cymen.org/2011/11/10/jquery-jcrop-plugin-chromewebkit-fails-to-initialize-after-the-first-attempt

The problem is in Areas/Contents/Views/TextContent/tempfile.aspx

The Fix is to put the crop code after line 111 in a setTimeout function.
Code:

loadImage = function (imageUrl) {
                    $('<img/>').hide().appendTo('body').attr('src', imageUrl)
                .load(function () {
                    kooboo.cms.ui.loading().hide();

                    img.attr('src', imageUrl).show();
                    
                    // need to be out of setTimeout or croping wont work right
                    var source = $(this);

                   // there needs to be a delay after setting image source becouse of new webkit browsers
                    setTimeout(function () {

                        sourceHeight = source.height(),
                        sourceWidth = source.width(),
                        param.Url = imageUrl,
                        croperWidth = img.width(),
                        croperHeight = img.height(),
                        sXY = sourceWidth / sourceHeight,
                        crXY = croperWidth / croperHeight,
                        ctXY = imgContainerWidth / imgContainerHeight;

                        if (sXY > ctXY) {
                            percent = croperWidth / sourceWidth;
                        } else {
                            if (sXY > 1) {
                                percent = croperWidth / sourceWidth;
                            } else {
                                percent = croperHeight / sourceHeight;
                            }
                        }

                        if (counter > 0) {
                            jcropAPI.destroy();
                        }

                        var cropSetting = _cropCls.settings.crop || {};
                        cropSetting['onChange'] = cropChange;
                        cropSetting['onSelect'] = cropChange;
                        if (cropSetting.minSize
                        && cropSetting.minSize[0]
                        && cropSetting.minSize[1]) {
                            cropSetting.minSize[0] = cropSetting.minSize[0] * percent;
                            cropSetting.minSize[1] = cropSetting.minSize[1] * percent;
                        }

                        jcropAPI = $.Jcrop(img, cropSetting);

                        var select = getSelect(percent, croperWidth, croperHeight);
                        if (select) {
                            jcropAPI.setSelect(select);
                        }

                        counter++;
                    },200);// 25 ms is not enough
                });
1 user thanked Hrvoje_86 for this useful post.
jifeng on 11/21/2011(UTC)
Users browsing this topic
Guest (2)
2 Pages12>
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF 1.9.5.5 | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.246 seconds.