TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Photo Metadata and Search on MacOS

90 pointsby jjwisemanover 7 years ago

7 comments

haikugingerover 7 years ago
Your script has what looks to be a pretty big inefficiency here[1] that&#x27;s slowing it down. Looping over a set kills the constant-time presence-checking that you get from using that data structure; it will likely be much faster to do something like this:<p><pre><code> tags = list(set(descr.split()) &amp; categories) </code></pre> The following would also work:<p><pre><code> tags = [x for x in descr.split() if x in categories] </code></pre> [1]<a href="https:&#x2F;&#x2F;gist.github.com&#x2F;28mm&#x2F;9820bd8b6eb27555efe9d6f46dd95a81#file-gistfile1-txt-L97" rel="nofollow">https:&#x2F;&#x2F;gist.github.com&#x2F;28mm&#x2F;9820bd8b6eb27555efe9d6f46dd95a8...</a>
评论 #16286291 未加载
saagarjhaover 7 years ago
&gt; Undoubtedly, launchd can be told to disable photolibraryd, but the approved mechanism wasn’t immediately obvious to me.<p>You want &quot;launchctl unload &#x2F;System&#x2F;Library&#x2F;LaunchAgents&#x2F;com.apple.photolibraryd.plist&quot;.
评论 #16286652 未加载
评论 #16285551 未加载
kennethfriedmanover 7 years ago
It&#x27;s also absolute madness that the native Photos app on iOS will not search the meta-data of the photos, only of the apple-restricted &quot;scene recognition&quot; objects, and dates.<p>Add a description to a photo, search for that description in Photos for iOS, and there will be no results.
评论 #16287103 未加载
reaperducerover 7 years ago
This is a major shortcoming of MacOS to those of us who use it heavily for photography. Or even those with large cameraphone libraries.<p>The data is there. It should be available to all applications!
Someoneover 7 years ago
<i>”Instead, I opted for an egregious hack. In order to lock its database, photoslibraryd, need to be able to write to it. I simply removed write permisions. […] Now, it’s possible to open $photodb, and poke around.“</i><p>If photolibraryd has that file open permanently for exclusive access, I think that shouldn’t work; photolibraryd either should keep write rights and others shouldn’t be able to open the file, as long as it has the file open, or you run the risk of database corruption (probably recoverable) when photolibraryd can only write half of what it wants to write (which will happen is, I think, implementation defined because of the existence of NFS)<p>I also think it is unlikely that photolibraryd has code checking for that the file becomes read only ⇒ apparently, photolibraryd periodically reopens that file for writing. If so, one should be able to race it for exclusively opening it.<p>Also, I’m curious. Photos.app must have a way to open that database for writing. How does it do that? Does it stop photolibraryd? Send it a signal?
评论 #16294108 未加载
gioboxover 7 years ago
This is a clever idea. I had just assumed that the photoanalysisd tags were indexed by Spotlight already!
woolvalleyover 7 years ago
I hope he files a radar about this :)