Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change loaded image #75

Closed
guybashan opened this issue Feb 27, 2016 · 4 comments
Closed

Change loaded image #75

guybashan opened this issue Feb 27, 2016 · 4 comments

Comments

@guybashan
Copy link

Is there an option of changing the loaded image? For example, I need to crop the image for a specific size. Here is my current code which doesn't work:

    cell.courseImageView.load(course.imageUrl, placeholder: nil) { URL, image, error, cacheType in
        if let anImage = image {
            let croppedImage = Util.imageByCroppingImage(anImage, size: cell.frame.size)

            if cacheType == CacheType.None {
                let transition = CATransition()
                transition.duration = 0.5
                transition.type = kCATransitionFade
                cell.courseImageView.layer.addAnimation(transition, forKey: nil)
            }

            cell.courseImageView.image = croppedImage
        }
    }

    return cell
}
@hirohisa
Copy link
Owner

hirohisa commented Mar 4, 2016

Thank you, @bashan .

I will investigate it. By the way, do you use automaticallyAdjustsSize? It's autoresize property.

@guybashan
Copy link
Author

No, How can I use it? Where can it be set?

Please note, that I need the image to be cropped from the center and not just scaled.

@hirohisa
Copy link
Owner

hirohisa commented Mar 5, 2016

Sorry, I did not explain enough.

First,
Is there an option of changing the loaded image? No. I will investigate it and fix #76.

Second,
automaticallyAdjustsSize that is ImageLoader's property automatically controls to an image size to small with contentMode.

I will note about changelog and more to README.
Thank you.

@hirohisa
Copy link
Owner

merged #76

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants