Giter Club home page Giter Club logo

mgimageutilities's People

Contributors

atnan avatar mattgemmell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mgimageutilities's Issues

Broken on images taken by device's camera in portrait

I tried using this category on a project that has camera functionality. Unfortunately the scaled output is screwy when the input image is a photo taken in portrait mode. It comes out distorted. The type and magnitude of the distortion varies depending on what scaling mode you use, but it's always pretty severe.

Try using the image file below (direct from my iphone 4s) in the sample project. The distortion appears there for me.

https://dl.dropbox.com/u/24362489/image.jpg

IOS 6 Invalid Context Issue

Hi,

If I use the categories on an IOS 6 SDK project. I am getting the following on the console:

: CGContextDrawImage: invalid context 0x0
: CGBitmapContextCreateImage: invalid context 0x0

While debugging it I am able to pinpoint the issue but have not been able to find a remedy for it. The issue is that context is null:

CGContextRef context = CGBitmapContextCreate(NULL, scaledWidth, scaledHeight, 8, (scaledWidth * 4),colorSpace, kCGImageAlphaPremultipliedLast);

Any solution you can provide would be a great help.

Didnot find any parameter which supports the cropping of image diagonally.

Hi,

I looked out the code & tried with several ways. though the cropping is supported in the whole image i,e By passing the origin & size parameters but I didn't find where user can crop the image like a Right Angle Triangle , means cropping at an angle of 45 *.
  • (UIImage *)imageToFitSize:(CGSize)fitSize method:(MGImageResizingMethod)resizeMethod;

This method doesnot support cropping if user wish to have the partial image since one wo'nt be able to pass the paramters other than Height ,width & Origin.

Required Output :

   -------
   |\      |
   |  \    |
   |    \  |
   |      \|
   -------

Availability check

There is a problem with the current availability check. In UIImage+Tint.m the current code is:

#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 40000
        if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 4.0) {
            UIGraphicsBeginImageContextWithOptions([self size], NO, 0.0); // 0.0 for scale means "scale for device's main screen".
        }
#else
        if ([[[UIDevice currentDevice] systemVersion] floatValue] < 4.0) {
            UIGraphicsBeginImageContext([self size]);
        }
#endif

However, imagine you compile against iOS 4.0, so __IPHONE_OS_VERSION_MAX_ALLOWED will be 40000, thus only

        if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 4.0) {
            UIGraphicsBeginImageContextWithOptions([self size], NO, 0.0); // 0.0 for scale means "scale for device's main screen".
        }

will get compiled. Now run the app in iOS prior to 4.0 and no context will get created, since the if-statement will return NO. Vice versa is the same of course, compiled against 3.x.x and run in iOS 4.x.x will not work.

I have a fork already available at http://github.com/JoostK/MGImageUtilities which fixes the problem.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.