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

Deflate decoder is not yet implemented #18

Open
rdkgit opened this issue Feb 3, 2023 · 7 comments
Open

Deflate decoder is not yet implemented #18

rdkgit opened this issue Feb 3, 2023 · 7 comments
Labels
enhancement New feature or request

Comments

@rdkgit
Copy link

rdkgit commented Feb 3, 2023

Please fill out as much known and relevant information as possible.

Version Information:

  • TIFF iOS Version: 4.0.1
  • TIFF iOS Source: (e.g. CocoaPods, Source Code Build) Build from source
  • CocoaPods Version: 4.0.2
  • Xcode Version: 14.2
  • Device or Emulator: iphone 14 ios 16.2
  • iOS Version: 16.2
  • Other Relevant Libraries:

Expected Results:

  • What did you expect to happen? Loaded a geotiff file (that works with android library) and tried to access rasters and it crashes with error "Deflate decoder is not yet implemented"

Observed Results:

  • What happened instead? "Deflate decoder is not yet implemented"
  • How often does this occur? Consistent

Output:

  • Any logs, errors, or output messages?
  • Terminating app due to uncaught exception 'Not Implemented', reason: 'Deflate decoder is not yet implemented'
    *** First throw call stack:
    (
    0 CoreFoundation 0x000000018040e7c8 __exceptionPreprocess + 172
    1 libobjc.A.dylib 0x0000000180051144 objc_exception_throw + 56
    2 CoreFoundation 0x000000018040e6d8 -[NSException initWithCoder:] + 0
    3 tiff_ios 0x000000010079ef38 -[TIFFDeflateCompression decodeData:withByteOrder:] + 96
    4 tiff_ios 0x0000000100792b1c -[TIFFFileDirectory tileOrStripWithX:andY:andSample:] + 1700
    5 tiff_ios 0x0000000100791b3c -[TIFFFileDirectory readRastersWithWindow:andSamples:andRasters:] + 1256
    6 tiff_ios 0x00000001007915f0 -[TIFFFileDirectory readRastersWithWindow:andSamples:andSampleValues:andInterleaveValues:] + 1460
    7 tiff_ios 0x0000000100790d44 -[TIFFFileDirectory readRastersWithWindow:andSamples:] + 112
    8 tiff_ios 0x0000000100790aec -[TIFFFileDirectory readRastersWithWindow:] + 72
    9 tiff_ios 0x0000000100790a04 -[TIFFFileDirectory readRasters] + 72

Steps to Reproduce:

  1. Step One
  2. Step Two
  3. ...

Relevant Code:

ios swift
rasters = directory!.readRasters()

// Code to reproduce the problem?

Test Files:

Additional Information:

  • Any additional configuration, data, or information that might help with the issue?
@rdkgit rdkgit added the bug Something isn't working label Feb 3, 2023
@bosborn bosborn added enhancement New feature or request and removed bug Something isn't working labels Feb 6, 2023
@bosborn
Copy link
Contributor

bosborn commented Feb 6, 2023

[NSException raise:@"Not Implemented" format:@"Deflate decoder is not yet implemented"];

[NSException raise:@"Not Implemented" format:@"Deflate encoder is not yet implemented"];

@rdkgit
Copy link
Author

rdkgit commented Feb 6, 2023

Hey! We are using the Java version (in android project) of this library which implements this feature and would be nice if our iOS version had equivalent functionality. Thank you.

@bosborn
Copy link
Contributor

bosborn commented Feb 6, 2023

It was a pull request we pulled into the Java library which is why the libraries aren't synched for deflate compression. It could probably be implemented on iOS using ZLIB compression.

@rdkgit
Copy link
Author

rdkgit commented Feb 6, 2023

Hi!

Hey, last question on this. I'm trying to flow the exception so my app does not exit. It looks like the exception is generated but that exception does not filter back to the caller.

do {
rasters = try directory!.readRasters()
}
catch {
}

readRasters() certainly trips the fault but Xcode is telling me that no calls to throwing functions occur within try expression.

Is there a way to catch this exception?

Bobby

@bosborn
Copy link
Contributor

bosborn commented Feb 7, 2023

I don't think there currently is a way to catch exceptions when calling Swift to Objective-C. The library would need to be updated to support Cocoa's error pattern.

https://developer.apple.com/documentation/swift/handling-cocoa-errors-in-swift
In Swift, you can recover from errors passed using Cocoa’s error pattern, as described above in Catch Errors. However, there’s no safe way to recover from Objective-C exceptions in Swift. To handle Objective-C exceptions, write Objective-C code that catches exceptions before they reach any Swift code.

@mkrupczak3
Copy link

Thought I'd chip in here:

We've gotten great results using the equivalent tiff-java library with the OpenAthena project, which allows users to tap-to-locate any point in a drone image:

tap_to_locate_demo_small

@rdkgit is hard at work on an iOS version, however an issue we're encountering is that some methods used to create a GeoTIFF file automatically compress larger-sized rasters, making them incompatible with this iOS library.

Equivalent capabilities for this iOS library may provide significant benefits for the NGA and its partners. It seems like a common use case that could deliver a lot of value

@bosborn
Copy link
Contributor

bosborn commented May 17, 2023

There are no near term plans to implement this at the moment, but open to pull requests if someone wants to take a shot.

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

No branches or pull requests

3 participants