Coder Social home page Coder Social logo

mz2 / carpaccio Goto Github PK

View Code? Open in Web Editor NEW
118.0 5.0 14.0 256.17 MB

A fast Swift library for decoding images (including the usual formats + RAW files) + EXIF metadata.

License: MIT License

Swift 99.21% Shell 0.39% C 0.40%
swift swift-package-manager photography raw exif

carpaccio's Introduction

Carpaccio icon

Carpaccio SPM build & test passes Swift Package Manager compatible

Pure Swift goodness for RAW and other image + metadata handling

Carpaccio is a Swift library for macOS and iOS that allows fast decoding of image data & EXIF metadata from file formats supported by CoreImage (including all the various RAW file formats supported, using the CoreImage RAW decoding capability).

  • thumbnails
  • metadata
  • full sized image

Carpaccio uses multiple CPU cores efficiently in parallel for all of metadata, thumbnail and image data decoding.

There are no 3rd party dependencies (CoreImage filter is used for RAW decoding).

INSTALLATION

Swift Package Manager

Add Carpaccio to your Swift package as a dependency by adding the following to your Package.swift file in the dependencies array:

.package(url: "https://github.com/mz2/Carpaccio.git", from: "<version>")

If you are using Xcode 11 or newer, you can add Carpaccio by entering the URL to the repository via the File menu:

File > Swift Packages > Add Package Dependency...

USAGE

For usage examples, consult the unit tests under Tests/CarpaccioTests.

TODO

Carpaccio is still a very fresh and raw (har har) library and there are many tasks to make this a more generally useful library.

  • Add tests for RAWs from a number of different camera vendors.
  • GitHub action CI support.
  • iOS support.
  • Working xcframework support (when Xcode / SPM toolchain permits?) An xcframework build is already made available, but at least with Xcode 12.5.1 this results in build fails of the following kinds:
    • 'where' clause cannot be applied to a non-generic top-level declaration
    • 'Iterator' is not a member type of type 'Self'
    • 'Iterator' is not a member type of type 'Self'
    • Covariant 'Self' can only appear as the type of a property, subscript or method result; did you mean 'Collection'?
    • 'Index' is not a member type of class 'Carpaccio.Collection'

carpaccio's People

Contributors

markuspiipari avatar mike-engel avatar mz2 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

carpaccio's Issues

Cannot select "Carpaccio.xcodeproj" in "Embedded Binaries"

Couldn't select "Carpaccio.xcodeproj" in "Embedded Binaries" so i added "Carpaccio.frameworkiOS".
When i added code given in the document to process RAW file it throws error ---> Use of unresolved identifier 'RAWImageLoader'.
Help me to solve this problem.
Thanks!!

Xcode 13 Beta

Hello, and I'd like to echo others in saying thank you for this project. It has been really helpful.

I found when using it in Xcode 13 Beta (on macOS 12.0 beta) I needed to make this change to Sources/Carpaccio/CIImage+Extensions.swift:

thejimmyg@2d0078c

+       // This is deprecated in XCode 13 Beta and causes the code not to build. What should be used instead?
+       // https://developer.apple.com/documentation/coreimage/cirawfilteroption/3334940-ciinputenableedrmodekey
        
        // Preserve pixel values beyond 0.0 … 1.0, which wide colour images will have
-       rawFilter.setValue(true, forKey: kCIInputEnableEDRModeKey)
+       // rawFilter.setValue(true, forKey: kCIInputEnableEDRModeKey)

Without it I get this error and the project won't build:

Cannot convert value of type 'CIRAWFilterOption' to expected argument type 'String'

I'm not sure what the correct thing to do is rather than just commenting that line out but with this change the code builds and seems to work OK to my eyes but I thought I'd ask if you knew a better solution?

See https://developer.apple.com/documentation/coreimage/cirawfilteroption/3334940-ciinputenableedrmodekey

Thanks!

Make Podspec working

Hi,

I was trying to update your Podspec, unfortunately it's still not working (see my branch), but I think together we can figure out this problem.

Currently, I have the following problems:

- ERROR | file patterns: The `preserve_paths` pattern did not match any file.
- ERROR | file patterns: The `vendored_libraries` pattern did not match any file.
- ERROR | xcodebuild: Returned an unsuccessful exit code.
- ERROR | xcodebuild:  Carpaccio/Carpaccio/RAWConverter.h:27:46: error: unknown type name 'NSImage'
- NOTE  | xcodebuild:  Carpaccio/Carpaccio/RAWConverter.mm:11:9: fatal error: 'Cocoa/Cocoa.h' file not found

Support for more metadata fields?

First off, thanks for making this project! It's been really helpful for loading and grabbing thumbnails of photos, especially RAW photos!

I'm wondering if there are plans to add more metadata fields in the future? Ones that come to mind are lens info, exif data like Title, Description, etc. If this should be in user-land, maybe just exposing the metadata dict in either the ImageLoader or ImageMetadata structs?

I'm happy to take a first pass at a PR, but wanted to check if there was a reason they were left out from the project.

ImageMetadata loaded with loadFullSizeImage doesn't contain valuable information

ImageMetadata doesn't contain valuable information when you call
loadFullSizeImage(options: FullSizedImageLoadingOptions, handler: @escaping PresentableImageHandler, errorHandler: @escaping ImageLoadingErrorHandler)

because the handler is run with empty ImageMetadata: handler(nonNilNakedImage, ImageMetadata(nativeSize: nonNilNakedImage.size))

I think this should be changed to handler(nonNilNakedImage, metadata)

CIImage creation out of Sony ARW from iOS

Hi! Thank you for the great work!

Did you notice by any chance that Sony ARW photos are not getting processed on iOS? (The same exact snippet working on macOS M1).

I'm joining an example image.

sony_a7s_iii_20.arw.zip

And the example code.

let loader = ImageLoader(imageURL: fileItem.url, thumbnailScheme: ImageLoader.ThumbnailScheme.decodeFullImage)
let (ciImage, metadata) = try loader.loadCIImage(options: ImageLoadingOptions(allowDraftMode: true), cancelled: nil)
// On iOS, the line above throws the exception "Failed to decode image at [...]" while it completes correctly on macOS.

Thank you!

Not working with Fuji RAF files

I've tried using your library with Fuji .RAF files and it failed to load the image metadata.

Adding "raf" to the list of RAWImageFileExtensions seems to fix the problem.

Any chance you can add this?

Image size related test failure

@markuspiipari I noticed after your recent changes, Travis is complaining regarding one of the EXIF metadata / image size related tests:

[CarpaccioTests_iOS.CarpaccioTests testSonyRAWConversion] : XCTAssertEqual failed: ("1078.0") is not equal to ("1080.0") -

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.