Date   

Re: Loading tiff files

Sandor Szatmari
 

Jens,

On Jan 28, 2021, at 14:18, Jens Alfke <jens@...> wrote:



On Jan 28, 2021, at 9:23 AM, Alex Zavatone via groups.io <zav@...> wrote:

Don’t worry.  We all fall into that trap - more often than you might expect.  You wouldn’t imagine how many times when I was preparing an email to the list when I reread what I was typing, looked at the docs again and realized I read over the solution and completely missed it.

That happens to me too. Or even better, while composing the email I write "could it be something about ____?", then go check on that possibility and find that indeed it was the problem. (A type of Rubber Duck Debugging.)

Or, confessional debugging.  You find the problem while explaining how your code ‘works’ to someone else…

Sandor


Sorry I was snarky earlier…

—Jens


Re: Loading tiff files

 



On Jan 28, 2021, at 9:23 AM, Alex Zavatone via groups.io <zav@...> wrote:

Don’t worry.  We all fall into that trap - more often than you might expect.  You wouldn’t imagine how many times when I was preparing an email to the list when I reread what I was typing, looked at the docs again and realized I read over the solution and completely missed it.

That happens to me too. Or even better, while composing the email I write "could it be something about ____?", then go check on that possibility and find that indeed it was the problem. (A type of Rubber Duck Debugging.)

Sorry I was snarky earlier…

—Jens


Re: Loading tiff files

Alex Zavatone
 

Don’t worry.  We all fall into that trap - more often than you might expect.  You wouldn’t imagine how many times when I was preparing an email to the list when I reread what I was typing, looked at the docs again and realized I read over the solution and completely missed it.

Happy that there enough good people here to take their time to help us all out.  And while we’re at it, thanks to Mr. Snej for starting these lists after Apple got tired of running them.

- Alex Zavatone

On Jan 27, 2021, at 9:33 PM, tridiak <tridiaknz@...> wrote:

My mistake. I should really stop skim reading.
Now I feel stupid.

On 28/01/2021, at 1:13 PM, Jens Alfke <jens@...> wrote:



On Jan 26, 2021, at 5:25 PM, tridiak <tridiaknz@...> wrote:

NSImage documentation not very informative what can open tiff.

Oh? It says so right in the class overview.

"The NSImage class itself is capable of managing image data in a variety of formats. The specific list of formats is dependent on the version of the operating system but includes many standard formats such as TIFF, JPEG, GIF, PNG, and PDF among others."

—Jens



Re: Loading tiff files

tridiak
 

My mistake. I should really stop skim reading.
Now I feel stupid.

On 28/01/2021, at 1:13 PM, Jens Alfke <jens@...> wrote:



On Jan 26, 2021, at 5:25 PM, tridiak <tridiaknz@...> wrote:

NSImage documentation not very informative what can open tiff.

Oh? It says so right in the class overview.

"The NSImage class itself is capable of managing image data in a variety of formats. The specific list of formats is dependent on the version of the operating system but includes many standard formats such as TIFF, JPEG, GIF, PNG, and PDF among others."

—Jens


Re: Loading tiff files

Alex Zavatone
 

On Jan 27, 2021, at 6:25 PM, Alex Zavatone via groups.io <zav@...> wrote:

Yep.

The NSImage class itself is capable of managing image data in a variety of formats. The specific list of formats is dependent on the version of the operating system but includes many standard formats such as TIFF, JPEG, GIF, PNG, and PDF among others. AppKit manages each format using a specific type of image representation object, whose job is to manage the actual image data. You can get a list of supported formats using the methods described in Determining Supported Types of Images.


It’s odd though that the link in the doc is a link to the same doc.



On Jan 27, 2021, at 6:13 PM, Jens Alfke <jens@...> wrote:



On Jan 26, 2021, at 5:25 PM, tridiak <tridiaknz@...> wrote:

NSImage documentation not very informative what can open tiff.

Oh? It says so right in the class overview.

"The NSImage class itself is capable of managing image data in a variety of formats. The specific list of formats is dependent on the version of the operating system but includes many standard formats such as TIFF, JPEG, GIF, PNG, and PDF among others."

—Jens



Re: Loading tiff files

Alex Zavatone
 

Yep.

The NSImage class itself is capable of managing image data in a variety of formats. The specific list of formats is dependent on the version of the operating system but includes many standard formats such as TIFF, JPEG, GIF, PNG, and PDF among others. AppKit manages each format using a specific type of image representation object, whose job is to manage the actual image data. You can get a list of supported formats using the methods described in Determining Supported Types of Images.


It’s odd though that the link in the doc is a link to the same doc.



On Jan 27, 2021, at 6:13 PM, Jens Alfke <jens@...> wrote:



On Jan 26, 2021, at 5:25 PM, tridiak <tridiaknz@...> wrote:

NSImage documentation not very informative what can open tiff.

Oh? It says so right in the class overview.

"The NSImage class itself is capable of managing image data in a variety of formats. The specific list of formats is dependent on the version of the operating system but includes many standard formats such as TIFF, JPEG, GIF, PNG, and PDF among others."

—Jens


Re: Loading tiff files

 



On Jan 26, 2021, at 5:25 PM, tridiak <tridiaknz@...> wrote:

NSImage documentation not very informative what can open tiff.

Oh? It says so right in the class overview.

"The NSImage class itself is capable of managing image data in a variety of formats. The specific list of formats is dependent on the version of the operating system but includes many standard formats such as TIFF, JPEG, GIF, PNG, and PDF among others."

—Jens


Re: Loading tiff files

Marco S Hyman
 

On Jan 26, 2021, at 5:25 PM, tridiak <tridiaknz@gmail.com> wrote:

NSImage documentation not very informative what can open tiff.
NSImage opens lots of image file types: jpg, tiff, many raw formats, etc. Instead of thinking “tif” think “image file”.


Re: Loading tiff files

tridiak
 

Ok. Thanks for help.
Google search gave me lots of ways of saving as tiff.
NSImage documentation not very informative what can open tiff.

On 27/01/2021, at 12:58 PM, Jens Alfke <jens@...> wrote:



On Jan 26, 2021, at 3:45 PM, tridiak <tridiaknz@...> wrote:

Is there any way to programmatically load tiff image files?

Sure. All the standard APIs that load images (FYI, you didn't specify a platform) handle TIFF. It used to be the standard image format on OpenStep, so support is still pretty ubiquitous.

—Jens


Re: Loading tiff files

Marco S Hyman
 

On Jan 26, 2021, at 3:45 PM, tridiak <tridiaknz@gmail.com> wrote:

Is there any way to programmatically load tiff image files?
Or does there exist a library that can do such?
NSImage can do the job.


Re: Loading tiff files

Bill Pitcher
 

NSImage(contentsOf: heldURL )

On 27 Jan 2021, at 9:45 am, tridiak <tridiaknz@gmail.com> wrote:

Is there any way to programmatically load tiff image files?
Or does there exist a library that can do such?

Mark





Re: Loading tiff files

 



On Jan 26, 2021, at 3:45 PM, tridiak <tridiaknz@...> wrote:

Is there any way to programmatically load tiff image files?

Sure. All the standard APIs that load images (FYI, you didn't specify a platform) handle TIFF. It used to be the standard image format on OpenStep, so support is still pretty ubiquitous.

—Jens


Loading tiff files

tridiak
 

Is there any way to programmatically load tiff image files?
Or does there exist a library that can do such?

Mark


Re: folder entitlements EPERM

Jack Brindle
 

You can open the desired System Preference Security Pane from your app to help the user with making the selection you need. Many apps have pretty cool dialogs that not only direct the user to the pane, but also point out exactly what needs to be done in that pane.

Do a web search for MacOS System Preference Links to find a listing of the URLs. As an example, the link for Full Disk is:
x-apple.systempreferences:com.apple.preference.security?Privacy_AllFiles

The interesting Objective-C code looks like:

[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"x-apple.systempreferences:com.apple.preference.security?Privacy_AllFiles”]];

Enjoy!

Jack


On Jan 25, 2021, at 5:58 PM, Gerriet M. Denkmann <gerriet@...> wrote:



On 26 Jan 2021, at 08:28, Jack Brindle via groups.io <jackbrindle@...> wrote:

Not just app store apps, on Catalina and especially Big Sur, all apps.

The suggestion is to have the user drag the app to the “Full Disk Access” panel of the Security & Privacy’s Privacy pane. Then you should be able to get anywhere you’d like.

Thanks a lot! This is the perfect solution for my app:

System Preferences →  Security & Privacy → Privacy → Full Disk Access (bottom of left scroll view) → add or enable app in right scroll view.

Gerriet.


Jack


On Jan 25, 2021, at 3:36 PM, Jens Alfke <jens@...> wrote:



On Jan 25, 2021, at 9:12 AM, Gerriet M. Denkmann <gerriet@...> wrote:

There are quite a few folders, which behave absolutely normal using the Finder, but when my App tries to do:
open(folderPath, O_RDONLY)
it gets an EPERM error: "Operation not permitted”.

When my App  shows an OpenPanel (with this un-opened folder), and the user clicks ok, then the open() works just fine.

Isn't that just the normal behavior of the app sandbox? Sandboxed apps aren't allowed to access arbitrary areas of the filesystem, unless the user has implicitly given permission by navigating to a file/folder in an Open panel, or dropping a document, etc.

—Jens







Re: folder entitlements EPERM

Alex Zavatone
 

Check out how Carbon Copy Cloner does it if you haven’t seen it recently.

On Jan 25, 2021, at 7:58 PM, Gerriet M. Denkmann <gerriet@mdenkmann.de> wrote:



On 26 Jan 2021, at 08:28, Jack Brindle via groups.io <jackbrindle=me.com@groups.io> wrote:

Not just app store apps, on Catalina and especially Big Sur, all apps.

The suggestion is to have the user drag the app to the “Full Disk Access” panel of the Security & Privacy’s Privacy pane. Then you should be able to get anywhere you’d like.
Thanks a lot! This is the perfect solution for my app:

System Preferences → Security & Privacy → Privacy → Full Disk Access (bottom of left scroll view) → add or enable app in right scroll view.

Gerriet.


Jack


On Jan 25, 2021, at 3:36 PM, Jens Alfke <jens@mooseyard.com> wrote:



On Jan 25, 2021, at 9:12 AM, Gerriet M. Denkmann <gerriet@mdenkmann.de> wrote:

There are quite a few folders, which behave absolutely normal using the Finder, but when my App tries to do:
open(folderPath, O_RDONLY)
it gets an EPERM error: "Operation not permitted”.

When my App shows an OpenPanel (with this un-opened folder), and the user clicks ok, then the open() works just fine.
Isn't that just the normal behavior of the app sandbox? Sandboxed apps aren't allowed to access arbitrary areas of the filesystem, unless the user has implicitly given permission by navigating to a file/folder in an Open panel, or dropping a document, etc.

—Jens





Re: folder entitlements EPERM

Gerriet M. Denkmann
 

On 26 Jan 2021, at 08:28, Jack Brindle via groups.io <jackbrindle=me.com@groups.io> wrote:

Not just app store apps, on Catalina and especially Big Sur, all apps.

The suggestion is to have the user drag the app to the “Full Disk Access” panel of the Security & Privacy’s Privacy pane. Then you should be able to get anywhere you’d like.
Thanks a lot! This is the perfect solution for my app:

System Preferences → Security & Privacy → Privacy → Full Disk Access (bottom of left scroll view) → add or enable app in right scroll view.

Gerriet.


Jack


On Jan 25, 2021, at 3:36 PM, Jens Alfke <jens@mooseyard.com> wrote:



On Jan 25, 2021, at 9:12 AM, Gerriet M. Denkmann <gerriet@mdenkmann.de> wrote:

There are quite a few folders, which behave absolutely normal using the Finder, but when my App tries to do:
open(folderPath, O_RDONLY)
it gets an EPERM error: "Operation not permitted”.

When my App shows an OpenPanel (with this un-opened folder), and the user clicks ok, then the open() works just fine.
Isn't that just the normal behavior of the app sandbox? Sandboxed apps aren't allowed to access arbitrary areas of the filesystem, unless the user has implicitly given permission by navigating to a file/folder in an Open panel, or dropping a document, etc.

—Jens


Re: folder entitlements EPERM

Jack Brindle
 

Not just app store apps, on Catalina and especially Big Sur, all apps.

The suggestion is to have the user drag the app to the “Full Disk Access” panel of the Security & Privacy’s Privacy pane. Then you should be able to get anywhere you’d like.

Jack


On Jan 25, 2021, at 3:36 PM, Jens Alfke <jens@...> wrote:



On Jan 25, 2021, at 9:12 AM, Gerriet M. Denkmann <gerriet@...> wrote:

There are quite a few folders, which behave absolutely normal using the Finder, but when my App tries to do:
open(folderPath, O_RDONLY)
it gets an EPERM error: "Operation not permitted”.

When my App  shows an OpenPanel (with this un-opened folder), and the user clicks ok, then the open() works just fine.

Isn't that just the normal behavior of the app sandbox? Sandboxed apps aren't allowed to access arbitrary areas of the filesystem, unless the user has implicitly given permission by navigating to a file/folder in an Open panel, or dropping a document, etc.

—Jens


Re: folder entitlements EPERM

Jon Gotow
 

On Jan 25, 2021, at 5:16 PM, Ben Kennedy <ben-groups@zygoat.ca> wrote:

Presumably you could solicit access to the root of the volume once, and thereafter build URLs for the relevant subpaths based on the security-scoped URL returned by the panel.

Per https://developer.apple.com/library/archive/documentation/Security/Conceptual/AppSandboxDesignGuide/AppSandboxInDepth/AppSandboxInDepth.html#//apple_ref/doc/uid/TP40011183-CH3-SW20 :
I got rejected from the App Store for doing that. However, there are lots of apps in the App Store that prompt for access to the root level of a disk using an Open dialog and get approved, so you may get lucky.

In my case, I didn't bother to fight it, as it was just for a free app (Go64). I released it directly on my website instead.

- Jon


Re: folder entitlements EPERM

Ben Kennedy
 

On 25 Jan 2021, at 9:12 am, Gerriet M. Denkmann <gerriet@mdenkmann.de> wrote:

When my App shows an OpenPanel (with this un-opened folder), and the user clicks ok, then the open() works just fine.

The problem: there might be a lot of these folders, and clicking dozens of OpenPanel becomes tedious rather fast.
Presumably you could solicit access to the root of the volume once, and thereafter build URLs for the relevant subpaths based on the security-scoped URL returned by the panel.

Per https://developer.apple.com/library/archive/documentation/Security/Conceptual/AppSandboxDesignGuide/AppSandboxInDepth/AppSandboxInDepth.html#//apple_ref/doc/uid/TP40011183-CH3-SW20 :

When a user of your app specifies they want to use a file or a folder, the system adds the associated path to your app’s sandbox. Say, for example, a user drags the ~/Documents folder onto your app’s Dock tile (or onto your app’s Finder icon, or into an open window of your app), thereby indicating they want to use that folder. In response, the system makes the ~/Documents folder, its contents, and its subfolders available to your app.
-ben


Re: folder entitlements EPERM

 



On Jan 25, 2021, at 9:12 AM, Gerriet M. Denkmann <gerriet@...> wrote:

There are quite a few folders, which behave absolutely normal using the Finder, but when my App tries to do:
open(folderPath, O_RDONLY)
it gets an EPERM error: "Operation not permitted”.

When my App  shows an OpenPanel (with this un-opened folder), and the user clicks ok, then the open() works just fine.

Isn't that just the normal behavior of the app sandbox? Sandboxed apps aren't allowed to access arbitrary areas of the filesystem, unless the user has implicitly given permission by navigating to a file/folder in an Open panel, or dropping a document, etc.

—Jens

81 - 100 of 1426