Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8003635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:42:00+00:00 2026-06-04T16:42:00+00:00

I am using this github image cropper: https://github.com/iosdeveloper/ImageCropper In this image cropper, in the

  • 0

I am using this github image cropper: https://github.com/iosdeveloper/ImageCropper

In this image cropper, in the init method they have these lines:

CGRect rect;
        rect.size.width = image.size.width;
        rect.size.height = image.size.height;

        [imageView setFrame:rect];

Beforehand, I resize the image to the screens resolution not points. So if I leave the code above the way it is, my UIImage will not fill the UIImageView for some odd reason, and I have tried to adjust the contentModes also.

But if I adjust it to this (the size of the UIPopover that the image cropper is in):

[imageView setFrame:CGRectMake(0, 0, 320, 480)];

The UIImage will fill the UIPopover.

The real issue is here:
If I zoom into a certain part of the image and execute the code below, it will take screenshot of the top left part of the UIImage no where near to where I have cropped the image to. Although it does abide by the scrollView’s zoomScale.

Here is the screenshot code:

- (void)finishCropping {

    float zoomScale = 1.0 / [scrollView zoomScale];

    CGRect rect;
    rect.origin.x = [scrollView contentOffset].x * zoomScale;
    rect.origin.y = [scrollView contentOffset].y * zoomScale;
    rect.size.width = [scrollView bounds].size.width * zoomScale;
    rect.size.height = [scrollView bounds].size.height * zoomScale;

    CGImageRef cr = CGImageCreateWithImageInRect([[imageView image] CGImage], rect);

    UIImage *cropped = [UIImage imageWithCGImage:cr];

    CGImageRelease(cr);

    [delegate imageCropper:self didFinishCroppingWithImage:cropped];
}

Does anyone know why this is happening?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T16:42:02+00:00Added an answer on June 4, 2026 at 4:42 pm

    I think you have at first to use [UIImage imageWithCGImage:cr scale:self.scale orientation:self.imageOrientation] instead [UIImage imageWithCGImage:cr] to create UIImage, this will take off many problems with orientation and double check the width and height are in the right direction in rect.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've created and SVG-file from an Illustrator-image. I'm using this: https://github.com/wout/raphael-svg-import to import and
I was able to setup Virtualbox with Gitlab using these instructions --> https://github.com/gitlabhq/gitlabhq/wiki/VirtualBox-Image .
I followed this tutorial: https://github.com/EllisLab/CodeIgniter/wiki/PDF-generation-using-dompdf However, I can't seem to set the path right.
I'm drawing an image to a canvas (using the cityTexture method in http://haldean.github.com/citycanvas/city.js )
I'm using Anything slider (https://github.com/ProLoser/AnythingSlider/wiki) and I have edited it so that the visitor
I have upload the video on facebook using following code Help From : https://github.com/zoul/facebook-ios-sdk/
i created a project by using this: https://github.com/gseitz/android-sbt-project.g8 When i start ensime in emacs
I am using this one https://github.com/markofjohnson/HJCache but it has some bugs and I don't
I am using this http://github.com/professionalnerd/simple-private-messages plugin in rails and I am on a user
I'm using the demo example in https://github.com/nicklockwood/AsyncImageView to load images asynchronously, however my app

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.