Opened 17 years ago
Last modified 6 years ago
#3768 new enhancement
Converter problem with Mac OS packages
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | low | Milestone: | |
Component: | converters | Version: | 1.5.0svn |
Severity: | minor | Keywords: | patch, os=macosx, triage |
Cc: | lasgouttes, Juergen Spitzmueller, bewihelm@…, younes@…, sts@…, Stephan Witt |
Description (last modified by )
LyX doesn't support graphics if they are stored as Mac OS X packages. Mac OS X packages are unix folders
disguised to look like single files. They are part of Mac OS X bundles (which may be packages, and also
some other folders and files).
When LyX converts graphics, some tests for checking that the input file exists are performed thanks to the
'IsFileReadable(string)' function (fileTools.c). The problem is that when this file is a Mac OS package, which
is for instance the case of '.graffle' figures (Omnigraffle software) only if they include images, it is actually
a unix folder, and thus isn't recognized as a file! This results in a "File not found" error message, and no
converter call. However, the file may really exist as a folder (a package).
Attachments (8)
Change History (45)
comment:1 by , 17 years ago
op_sys: | other → MacOS X |
---|
comment:2 by , 17 years ago
comment:3 by , 17 years ago
Keywords: | patch added |
---|
comment:4 by , 17 years ago
attachments.description: | A first patch which supports folders when they have an extension → A first patch that supports folders when they have an extension (for LyX 1.4.4) |
---|
by , 17 years ago
Attachment: | graphics-as-macos-packages.patch added |
---|
A first patch that supports folders when they have an extension (for LyX 1.4.4)
comment:5 by , 17 years ago
attachments.isobsolete: | 0 → 1 |
---|
comment:6 by , 17 years ago
Version: | 1.4.4 → 1.5.0svn |
---|
by , 17 years ago
Attachment: | graphics-as-macos-packages2.patch added |
---|
The same patch as 1837 but for LyX 1.5.0rc1
comment:7 by , 17 years ago
attachments.isobsolete: | 0 → 1 |
---|
by , 17 years ago
Attachment: | graphics-as-macos-packages3.patch added |
---|
A new patch for LyX 1.5.0rc1, where updates are managed through the timestamp
comment:8 by , 17 years ago
attachments.isobsolete: | 0 → 1 |
---|
by , 17 years ago
Attachment: | graphics-as-macos-packages3.2.patch added |
---|
Same patch as 1868, but in unified diff format
comment:9 by , 17 years ago
attachments.isobsolete: | 0 → 1 |
---|
comment:10 by , 17 years ago
Milestone: | → 1.5.1 |
---|
comment:11 by , 17 years ago
attachments.isobsolete: | 0 → 1 |
---|
comment:12 by , 17 years ago
Cc: | added |
---|
comment:14 by , 17 years ago
I am sorry but my time right now to handle this is a bit scarce and I do not
think that this problem (while annoying) is a top urgency for 1.5.0... My
thoughts about the patch:
- the function is_macos_file_readable should be renamed to something like is_readable_file_or_bundle and really check whether the file is a bundle. The check for non-null extension seems insufficient to me.
As an alternative, you could add a bool "allowbundle" in isFileReadable
so that it works correctly in cases where bundles are allowed. This would be
more elegant than using directly fs_extra stuff.
To find out whether a file is a bundle, it suffices to check the return value
of CFBundleGetPackageInfoInDirectory:
- I am not sure I understand what the patch does wrt checksums for directories. Does it just ignore them? In this case, I would prefer (although it is a big hack) a solution where we add at the beginning of sum() something like
if (is_directory(file))
return 1;
Later we will need a real sum for directories (until you have a good
alternative).
- concerning the OSX ifdefs: ideally there should be none. In practice, there should be none in files that do not already contain platform ifdefs.
comment:15 by , 17 years ago
Cc: | added |
---|
comment:16 by , 17 years ago
I tried to test this but was unable to do so.
- There seems to be something wrong with the 2 omnigraffle figures: one shows
up on my computer as a folder; the other shows up as a Unix Executable File. (I
don't have omnigraffle, so I otherwise am unable to test.)
- The proposed patch fails to apply against RC2 (as well as current svn):
02:12:51 | bennett:~/Desktop/lyx-1.5.0rc2> patch -p1 < ~/Desktop/test-graphics.diff
patching file src/ConverterCache.cpp
Hunk #1 FAILED at 279.
Hunk #2 FAILED at 388.
2 out of 2 hunks FAILED -- saving rejects to file src/ConverterCache.cpp.rej
patching file src/graphics/GraphicsCacheItem.cpp
Hunk #2 FAILED at 376.
1 out of 2 hunks FAILED -- saving rejects to file
src/graphics/GraphicsCacheItem.cpp.rej
patching file src/graphics/GraphicsConverter.cpp
Hunk #1 FAILED at 325.
1 out of 1 hunk FAILED -- saving rejects to file
src/graphics/GraphicsConverter.cpp.rej
patching file src/insets/InsetGraphics.cpp
Hunk #2 FAILED at 475.
Hunk #3 FAILED at 589.
Hunk #4 FAILED at 773.
3 out of 4 hunks FAILED -- saving rejects to file src/insets/InsetGraphics.cpp.rej
patching file src/support/FileMonitor.cpp
Hunk #1 FAILED at 98.
Hunk #2 FAILED at 169.
2 out of 2 hunks FAILED -- saving rejects to file src/support/FileMonitor.cpp.rej
patching file src/support/fs_extras.cpp
patching file src/support/fs_extras.h
comment:17 by , 17 years ago
- There seems to be something wrong with the 2 omnigraffle figures: one shows
up on my computer as a folder; the other shows up as a Unix Executable File. (I
don't have omnigraffle, so I otherwise am unable to test.)
You need OG to see the figures as packages. Otherwise "test2.graffle" will be
seen as a file and "test1.graffle" as a directory.
You can get a free copy of OG (but limited to 10 elements per figure AFAIR):
http://www.omnigroup.com/applications/omnigraffle/
- The proposed patch fails to apply against RC2 (as well as current svn):
02:12:51 | bennett:~/Desktop/lyx-1.5.0rc2> patch -p1 <
~/Desktop/test-graphics.diff
That's because of tabs: my text editor replaced them by spaces. Just add option
"-l" and that will be ignored.
comment:18 by , 17 years ago
Cc: | added |
---|
I'm not sure this is something for 1.5.1 (or rather 1.5.2). It needs to be
tested carefully, in any case.
by , 17 years ago
Attachment: | graphics-as-macos-packages7.patch added |
---|
Updated patch (for use with 1.5.0)
comment:19 by , 17 years ago
attachments.isobsolete: | 0 → 1 |
---|
comment:20 by , 17 years ago
Milestone: | 1.5.1 → 1.5.2 |
---|
1.5.1 is an emergency relelase. Moving all to 1.5.2
comment:21 by , 17 years ago
Milestone: | 1.5.2 → 1.5.3 |
---|
1.5.2 is frozen. This bug has to be postponed to 1.5.3.
comment:23 by , 16 years ago
Sorry, this bug didn't get the attention it deserved. Unfortunately, I do not
understand this stuff very well.
Jean-Marc, could you have a look at this issue, please?
follow-up: 34 comment:24 by , 16 years ago
Cc: | added |
---|
I am not sure what is the best way to handle this stuff, and I am a bit busy
these days. Stefan, do you have any ideas about that?
comment:25 by , 16 years ago
Milestone: | 1.5.4 → 1.5.5 |
---|
Soft freeze for 1.5.4: from now on, only critical bugs and regressions are
allowed.
comment:28 by , 15 years ago
Milestone: | 1.5.7 → 1.6.x |
---|
WONTFIX for 1.5. The status of this bug in 1.6.0 needs to be checked.
comment:29 by , 15 years ago
Priority: | high → low |
---|
comment:30 by , 15 years ago
Description: | modified (diff) |
---|---|
Keywords: | os=macosx added |
comment:31 by , 13 years ago
Milestone: | 1.6.x |
---|
comment:32 by , 12 years ago
Cc: | added; removed |
---|
comment:33 by , 10 years ago
Component: | convertors → converters |
---|
comment:34 by , 9 years ago
Cc: | added |
---|
Replying to lasgouttes:
I am not sure what is the best way to handle this stuff, and I am a bit busy
these days. Stefan, do you have any ideas about that?
Any comments Stephan? Is this bug still relevant and worth looking at?
comment:36 by , 9 years ago
Cc: | added; removed |
---|
comment:38 by , 3 years ago
Keywords: | triage added |
---|
As said Jean-Marc Lagouttes in the devel list (http://www.mail-archive.com/lyx-devel@lists.lyx.org/
msg118804.html), it would be better to use real Mac OS X code to determine whether a
directory is a package. According to Apple's Bundle Software Guide, the 'CFBundleCreate(...)' function
could do the job.
As also mentionned by Jean-Marc, CRC could be computed by iterating on the files inside the directory.