Skip to content

Commit

Permalink
Project cleanup, updated README file, improved template, putting the …
Browse files Browse the repository at this point in the history
…copy-paste trick back.
  • Loading branch information
onekiloparsec committed Mar 7, 2015
1 parent a7c1b78 commit ed0fd8c
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 33 deletions.
4 changes: 2 additions & 2 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github "onekiloparsec/AstroCocoaKit" "0.1.2"
github "onekiloparsec/ObjCFITSIO" "0.2.10"
github "onekiloparsec/AstroCocoaKit" "23ef7a53c3acdcfbd891d25cf1149dc0949845c9"
github "onekiloparsec/ObjCFITSIO" "136bb7ff26e74ebfc3ec09f85216f4562b7b6619"
12 changes: 0 additions & 12 deletions QLFits3.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
3BD8111F1BC2E0AA1CBD7C6A /* Pods-QLFits3.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-QLFits3.release.xcconfig"; path = "Pods/Target Support Files/Pods-QLFits3/Pods-QLFits3.release.xcconfig"; sourceTree = "<group>"; };
5B7E8491F608D40287A1B3AB /* Pods-QLFits3.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-QLFits3.debug.xcconfig"; path = "Pods/Target Support Files/Pods-QLFits3/Pods-QLFits3.debug.xcconfig"; sourceTree = "<group>"; };
9F087E641AAB5513001497A2 /* ObjCFITSIO.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ObjCFITSIO.framework; path = Carthage/Build/Mac/ObjCFITSIO.framework; sourceTree = "<group>"; };
9F276CC51AA7BD1500038036 /* template_error.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = template_error.html; sourceTree = "<group>"; };
9FF55C3A1A067BF4005AA2BD /* QLFits3.qlgenerator */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = QLFits3.qlgenerator; sourceTree = BUILT_PRODUCTS_DIR; };
Expand Down Expand Up @@ -80,15 +78,6 @@
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
0FB0C020AB7F0F6C6997F8DC /* Pods */ = {
isa = PBXGroup;
children = (
5B7E8491F608D40287A1B3AB /* Pods-QLFits3.debug.xcconfig */,
3BD8111F1BC2E0AA1CBD7C6A /* Pods-QLFits3.release.xcconfig */,
);
name = Pods;
sourceTree = "<group>";
};
5F80857175C128FA0C69EF83 /* Frameworks */ = {
isa = PBXGroup;
children = (
Expand All @@ -106,7 +95,6 @@
9FF55C3C1A067BF4005AA2BD /* QLFits3 */,
9FF55C3D1A067BF4005AA2BD /* Supporting Files */,
9FF55C3B1A067BF4005AA2BD /* Products */,
0FB0C020AB7F0F6C6997F8DC /* Pods */,
5F80857175C128FA0C69EF83 /* Frameworks */,
);
sourceTree = "<group>";
Expand Down
2 changes: 2 additions & 0 deletions QLFits3/GeneratePreviewForURL.m
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,10 @@ OSStatus GeneratePreviewForURL(void *thisInterface, QLPreviewRequestRef preview,
NSMutableString *HDULinesString = [NSMutableString string];

for (NSUInteger i = 0; i < MIN(MAX_HDU_COUNT, [fits countOfHDUs]); i++) {
#if ATTACH_IMAGES
NSString *rawFileName = [[(__bridge NSURL *)url lastPathComponent] stringByReplacingOccurrencesOfString:@"." withString:@"_"];
NSString *HDUImageFileName = [NSString stringWithFormat:@"QLFits3___%@___HDU%lu.tiff", rawFileName, i+1];
#endif
NSString *HDUImageString = nil;

// Table anchor is declared in template.html
Expand Down
8 changes: 6 additions & 2 deletions QLFits3/template.html
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,13 @@
<div class="label">QLFits: Flexible Image Transport System (FITS) OSX Quick Look Generator • Version __BundleVersion__</div>
</div>
<div class="section">
<div class="summary">This software is brought to you by <a href="onekilopars.ec">onekilopars.ec</a>, <i>far-reaching solutions for ground-based astronomers.</i> We also develop <b>iObserve</b> <a href="http://itunes.com/mac/iobserve">for Mac</a> and <a href="http://itunes.com/apps/cedricfollmi/iobserve">for iPad</a>, the best app for preparing your observations.</div>
<div class="summary">This FITS QuickLook plugin is based on the open source project <a href="https://github.com/onekiloparsec/ObjCFITSIO">ObjCFITSIO</a>, the Objective-C wrapper around cfitsio.</div>
<div class="summary">This software is brought to you by <a href="onekilopars.ec">onekilopars.ec</a>, <i>far-reaching solutions for ground-based astronomers.</i> We are known for developing <b>iObserve</b> <a href="http://itunes.com/mac/iobserve">for Mac</a> and <a href="http://itunes.com/apps/cedricfollmi/iobserve">for iPad</a>, the best app for preparing your observations!</div>
<div class="summary">This FITS QuickLook plugin is based on the open source project <a href="https://github.com/onekiloparsec/ObjCFITSIO">ObjCFITSIO</a>, the Objective-C wrapper around the excellent <a href="http://heasarc.gsfc.nasa.gov/fitsio/fitsio.html">cfitsio</a> library (thanks!).</div>
<div class="summary">You might also be interested by the <a href="https://github.com/onekiloparsec/FITSImporter">FITSImporter</a> plugin, a Spotlight plugin allowing to look for FITS file attributes with OSX' Spotlight.</div>
</div>
<div class="section" id="copy_help">
<div class="summary">Want to be able to copy-paste text from this Quick Look preview? <a href="http://www.macworld.com/article/1164668/select_and_copy_text_within_quick_look_previews.html">Follow these instructions</a>.</div>
</div>
</div>
</body>
</html>
29 changes: 12 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ QLFits 3
========

_Note: QLFits2 was broken on OX 10.9 Mavericks! This is the new QLFits3. It works for Mavericks (10.9) and up._
_Update (March 2015): QLFits3 had some troubles displaying images. It was due to a bug in OSX 10.10 Yosemite (and 10.9 Mavericks). It has been worked around._

QLFits is a OSX Quicklook plugin for FITS (Flexible Image transport System) files (used by astronomers worldwide to store and share their data.)

Expand All @@ -20,12 +21,9 @@ It is released open source under the [GNU General Public Licence](http://en.wiki
Installation
------------

*[Download the latest binary.](http://onekilopars.ec/softwares/QLFits3.qlgenerator.zip)*
*[Download the latest binary (3.0.2)](http://onekilopars.ec/softwares/QLFits3.qlgenerator.zip)*

Put the QLFits3.qlgenerator bundle in _/Library/QuickLook_ or _~/Library/QuickLook_ and run the (safe and instantenous) command: `/bin/sh qlmanage -r` to reset the quicklook daemon. Then, enjoy seeing the content of your FITS files in the Finder:

<img src="Resources/QLFits3_Finder_Screenshot.png" width=700px>
<img src="Resources/QLFits3_QL_Window.png" width=700px>
Put the QLFits3.qlgenerator bundle in _/Library/QuickLook_ (not in _~/Library/QuickLook_) and run the (safe and instantenous) command: `/bin/sh qlmanage -r` to reset the quicklook daemon.


Contribute!
Expand All @@ -34,21 +32,25 @@ Contribute!
If you want to contibute, you need:
* A recent Mac
* A copy of [Xcode](https://itunes.apple.com/fr/app/xcode/id497799835?l=en&mt=12) (Xcode 6, as of now, March 2015, but Xcode 5 should also work)
* A working installation of [Carthage](https://github.com/Carthage/Carthage) (Install it with Homebrew: `brew install carthage`)
* A working installation of [Carthage](https://github.com/Carthage/Carthage) (Install it with [Homebrew](http://brew.sh): `brew install carthage`)
* Some knowledge of Objective-C and C... and FITS!

Then,

1. simply fork this project on GitHub,
2. Go to the project directory, and run `carthage update`
3. make your modifications (I can help),
4. test (I can also help, if time permits, business as usual),
5. and submit a pull request.
3. Open QLFits3.xcproj and make your modifications (I can help),
4. Test – see Debugt below (I can also help, if time permits, business as usual),
5. Submit a pull request (via GitHub)!


How to debug
------------

* Build your (modified) QLFits3. Now, a new version is being put in /Library/QuickLook
* Navigate in the Finder to look for a FITS file, and press <space>.

Alternate method. _Note: What follows is supposed to work, but a bug in Yosemite prevents it._
In Xcode, you should locate the `qlmanage` binary file, and include it as the "Executable" in the "Run" section of the "QLFits3" scheme. To do so:

* Edit the "QLFits3" scheme in Xcode, select the "Run section"
Expand All @@ -68,16 +70,9 @@ Use `-t` to create thrumbnails instead of previews. You can put multiple entries
Project Notes For Developers
----------------------------


The following command line is run at the end of the Xcode build phase to ensure the QuickLook daemon is restarted: `/bin/sh qlmanage -r`

Once done, you can enjoy seeing the content of your FITS files directly in the Finder!

Note that you can use [FITSImporter](https://github.com/onekiloparsec/FITSImporter), the OSX Spotlight plugin for FITS file as good companion.

* The plug-in code must be signed. The "Code Signing Identity" build setting is to the "Developer ID: *" automatic setting. If you don't have a Developer ID, get creative.

* There is a Copy Files build phase that puts the Debug build of Provisioning.qlgenerator in your ~/Library/QuickLook folder.
* There is a Copy Files build phase that puts the Debug build of Provisioning.qlgenerator in your /Library/QuickLook folder.

* QuickLook plug-ins sometimes don't like to install. Learn to use "qlmanage -r" to reset the daemon. Using "qlmanage -m plugins" will tell you if the plug-in has been recognized. Sometimes you have to login and out before the plug-in is recognized.

Expand Down

0 comments on commit ed0fd8c

Please sign in to comment.