Peter Kümmel | 4 Oct 19:29

BUG: jpeg capital letters (.JPG) does not work with pdflatex

Here a patch for
http://bugzilla.lyx.org/show_bug.cgi?id=2235

Is there a better way to detect case sensitiveness
of the file actual system?

Peter
Index: insets/InsetGraphics.cpp
===================================================================
--- insets/InsetGraphics.cpp	(revision 26731)
+++ insets/InsetGraphics.cpp	(working copy)
@@ -668,7 +668,8 @@
 	LYXERR(Debug::GRAPHICS, "\tthe orig file is: " << orig_file);

 	if (from == to) {
-		if (!runparams.nice && getExtension(temp_file.absFilename()) != ext) {
+		if (!runparams.nice && !isFilesystemEqual(
+						getExtension(temp_file.absFilename()), ext)) {
 			// The LaTeX compiler will not be able to determine
 			// the file format from the extension, so we must
 			// change it.
Index: support/filetools.cpp
===================================================================
--- support/filetools.cpp	(revision 26731)
+++ support/filetools.cpp	(working copy)
@@ -607,7 +607,18 @@
 	return buf;
 }
(Continue reading)

Andre Poenitz | 4 Oct 20:21

Re: BUG: jpeg capital letters (.JPG) does not work with pdflatex

On Sat, Oct 04, 2008 at 07:30:46PM +0200, Peter Kümmel wrote:
> Here a patch for
> http://bugzilla.lyx.org/show_bug.cgi?id=2235
>
> Is there a better way to detect case sensitiveness
> of the file actual system?
>
> Peter

> Index: insets/InsetGraphics.cpp
> ===================================================================
> --- insets/InsetGraphics.cpp	(revision 26731)
> +++ insets/InsetGraphics.cpp	(working copy)
> @@ -668,7 +668,8 @@
>  	LYXERR(Debug::GRAPHICS, "\tthe orig file is: " << orig_file);
>  
>  	if (from == to) {
> -		if (!runparams.nice && getExtension(temp_file.absFilename()) != ext) {
> +		if (!runparams.nice && !isFilesystemEqual(
> +						getExtension(temp_file.absFilename()), ext)) {
>  			// The LaTeX compiler will not be able to determine
>  			// the file format from the extension, so we must
>  			// change it.
> Index: support/filetools.cpp
> ===================================================================
> --- support/filetools.cpp	(revision 26731)
> +++ support/filetools.cpp	(working copy)
> @@ -607,7 +607,18 @@
>  	return buf;
>  }
(Continue reading)

Peter Kümmel | 4 Oct 21:06

Re: BUG: jpeg capital letters (.JPG) does not work with pdflatex

Andre Poenitz wrote:
> On Sat, Oct 04, 2008 at 07:30:46PM +0200, Peter Kümmel wrote:
>> Here a patch for
>> http://bugzilla.lyx.org/show_bug.cgi?id=2235
>>
>> Is there a better way to detect case sensitiveness
>> of the file actual system?

> I don't know, but Mac's file system seems to be case-insensitive as well.
> Also, instead of toLower(), QString::compare(..., Qt::CaseInsensitive)
> seems preferable.

Are the filenames simply utf8 encoded?

--

-- 
Peter Kümmel
Index: insets/InsetGraphics.cpp
===================================================================
--- insets/InsetGraphics.cpp	(revision 26731)
+++ insets/InsetGraphics.cpp	(working copy)
@@ -668,7 +668,8 @@
 	LYXERR(Debug::GRAPHICS, "\tthe orig file is: " << orig_file);

 	if (from == to) {
-		if (!runparams.nice && getExtension(temp_file.absFilename()) != ext) {
+		if (!runparams.nice && !isFilesystemEqual(
+						getExtension(temp_file.absFilename()), ext)) {
 			// The LaTeX compiler will not be able to determine
(Continue reading)

Abdelrazak Younes | 4 Oct 21:47
Favicon

Re: BUG: jpeg capital letters (.JPG) does not work with pdflatex

On 04/10/2008 21:06, Peter Kümmel wrote:
> Andre Poenitz wrote:
>> On Sat, Oct 04, 2008 at 07:30:46PM +0200, Peter Kümmel wrote:
>>> Here a patch for
>>> http://bugzilla.lyx.org/show_bug.cgi?id=2235
>>>
>>> Is there a better way to detect case sensitiveness
>>> of the file actual system?
>
>> I don't know, but Mac's file system seems to be case-insensitive as 
>> well.
>> Also, instead of toLower(), QString::compare(..., Qt::CaseInsensitive)
>> seems preferable.
>
> Are the filenames simply utf8 encoded?

Yes, but please use (or extend) already existing FileName::operator==()

Abdel.

Peter Kümmel | 4 Oct 22:20

Re: BUG: jpeg capital letters (.JPG) does not work with pdflatex

Abdelrazak Younes wrote:
> On 04/10/2008 21:06, Peter Kümmel wrote:
>> Andre Poenitz wrote:
>>> On Sat, Oct 04, 2008 at 07:30:46PM +0200, Peter Kümmel wrote:
>>>> Here a patch for
>>>> http://bugzilla.lyx.org/show_bug.cgi?id=2235
>>>>
>>>> Is there a better way to detect case sensitiveness
>>>> of the file actual system?
>>
>>> I don't know, but Mac's file system seems to be case-insensitive as 
>>> well.
>>> Also, instead of toLower(), QString::compare(..., Qt::CaseInsensitive)
>>> seems preferable.
>>
>> Are the filenames simply utf8 encoded?
> 
> Yes, but please use (or extend) already existing FileName::operator==()

I only need to check the extension.

Peter
Index: insets/InsetGraphics.cpp
===================================================================
--- insets/InsetGraphics.cpp	(revision 26732)
+++ insets/InsetGraphics.cpp	(working copy)
@@ -668,7 +668,7 @@
 	LYXERR(Debug::GRAPHICS, "\tthe orig file is: " << orig_file);
(Continue reading)

Peter Kümmel | 5 Oct 13:55

Re: BUG: jpeg capital letters (.JPG) does not work with pdflatex

I've checked in a more generic patch:
http://www.lyx.org/trac/changeset/26744

Peter

Abdelrazak Younes | 5 Oct 14:56
Favicon

Re: BUG: jpeg capital letters (.JPG) does not work with pdflatex

On 05/10/2008 13:55, Peter Kümmel wrote:
> I've checked in a more generic patch:
> http://www.lyx.org/trac/changeset/26744

Good.

Abdel.

Peter Kümmel | 5 Oct 14:09

Re: BUG: jpeg capital letters (.JPG) does not work with pdflatex

Abdelrazak Younes wrote:
> 
> Yes, but please use (or extend) already existing FileName::operator==()
> 

FileName::operator==() expands now short names on Windows.
http://www.lyx.org/trac/changeset/26745

Peter

Peter Kümmel | 5 Oct 14:17

Re: BUG: jpeg capital letters (.JPG) does not work with pdflatex

Peter Kümmel wrote:
> Abdelrazak Younes wrote:
>>
>> Yes, but please use (or extend) already existing FileName::operator==()
>>
> 
> FileName::operator==() expands now short names on Windows.
> http://www.lyx.org/trac/changeset/26745
> 

Uwe, could you verify it and close the bug report?
http://bugzilla.lyx.org/show_bug.cgi?id=2235

Thanks,
Peter

Andre Poenitz | 5 Oct 15:42

Re: BUG: jpeg capital letters (.JPG) does not work with pdflatex

On Sun, Oct 05, 2008 at 02:09:03PM +0200, Peter Kümmel wrote:
> Abdelrazak Younes wrote:
>>
>> Yes, but please use (or extend) already existing FileName::operator==()
>>
>
> FileName::operator==() expands now short names on Windows.
> http://www.lyx.org/trac/changeset/26745

In this case I'd prefer a more verbose name. Having non-trivial
operations hidden in customarily "cheap" operators tend to create
unexpected behaviour...

Andre'

Peter Kümmel | 5 Oct 16:30

Re: BUG: jpeg capital letters (.JPG) does not work with pdflatex

Andre Poenitz wrote:
> On Sun, Oct 05, 2008 at 02:09:03PM +0200, Peter Kümmel wrote:
>> Abdelrazak Younes wrote:
>>> Yes, but please use (or extend) already existing FileName::operator==()
>>>
>> FileName::operator==() expands now short names on Windows.
>> http://www.lyx.org/trac/changeset/26745
> 
> In this case I'd prefer a more verbose name. Having non-trivial
> operations hidden in customarily "cheap" operators tend to create
> unexpected behaviour...

Or we always use long path names internaly, see patch.
--

-- 
Peter Kümmel
Index: src/support/FileName.cpp
===================================================================
--- src/support/FileName.cpp	(revision 26748)
+++ src/support/FileName.cpp	(working copy)
@@ -146,7 +146,8 @@

 
 FileName::FileName(string const & abs_filename)
-	: d(abs_filename.empty() ? new Private : new Private(abs_filename))
+	: d(abs_filename.empty() ? new Private 
+		: new Private(os::internal_path(abs_filename)))
 {
 }
(Continue reading)

Abdelrazak Younes | 5 Oct 16:40
Favicon

Re: BUG: jpeg capital letters (.JPG) does not work with pdflatex

On 05/10/2008 16:30, Peter Kümmel wrote:
> Andre Poenitz wrote:
>> On Sun, Oct 05, 2008 at 02:09:03PM +0200, Peter Kümmel wrote:
>>> Abdelrazak Younes wrote:
>>>> Yes, but please use (or extend) already existing 
>>>> FileName::operator==()
>>>>
>>> FileName::operator==() expands now short names on Windows.
>>> http://www.lyx.org/trac/changeset/26745
>>
>> In this case I'd prefer a more verbose name. Having non-trivial
>> operations hidden in customarily "cheap" operators tend to create
>> unexpected behaviour...
>
> Or we always use long path names internaly, see patch.

Yes, I prefer that.

Abdel.

Enrico Forestieri | 5 Oct 18:30
Favicon

Re: BUG: jpeg capital letters (.JPG) does not work with pdflatex

On Sun, Oct 05, 2008 at 04:40:35PM +0200, Abdelrazak Younes wrote:

> On 05/10/2008 16:30, Peter Kümmel wrote:
> > Andre Poenitz wrote:
> >> On Sun, Oct 05, 2008 at 02:09:03PM +0200, Peter Kümmel wrote:
> >>> Abdelrazak Younes wrote:
> >>>> Yes, but please use (or extend) already existing 
> >>>> FileName::operator==()
> >>>>
> >>> FileName::operator==() expands now short names on Windows.
> >>> http://www.lyx.org/trac/changeset/26745
> >>
> >> In this case I'd prefer a more verbose name. Having non-trivial
> >> operations hidden in customarily "cheap" operators tend to create
> >> unexpected behaviour...
> >
> > Or we always use long path names internaly, see patch.
> 
> Yes, I prefer that.

Please, don't do that. Short filenames allow to overcome bugs resulting
from having spaces or other special characters (not only in LyX, but
also when using external programs). If a pathname is transformed into its
long version, the simple countermeasure of using the short form is defeated.

--

-- 
Enrico

Peter Kümmel | 5 Oct 18:50

Re: BUG: jpeg capital letters (.JPG) does not work with pdflatex

Enrico Forestieri wrote:
> On Sun, Oct 05, 2008 at 04:40:35PM +0200, Abdelrazak Younes wrote:
> 
>> On 05/10/2008 16:30, Peter K�mmel wrote:
>>> Andre Poenitz wrote:
>>>> On Sun, Oct 05, 2008 at 02:09:03PM +0200, Peter K�mmel wrote:
>>>>> Abdelrazak Younes wrote:
>>>>>> Yes, but please use (or extend) already existing 
>>>>>> FileName::operator==()
>>>>>>
>>>>> FileName::operator==() expands now short names on Windows.
>>>>> http://www.lyx.org/trac/changeset/26745
>>>> In this case I'd prefer a more verbose name. Having non-trivial
>>>> operations hidden in customarily "cheap" operators tend to create
>>>> unexpected behaviour...
>>> Or we always use long path names internaly, see patch.
>> Yes, I prefer that.
> 
> Please, don't do that. Short filenames allow to overcome bugs resulting
> from having spaces or other special characters (not only in LyX, but
> also when using external programs). If a pathname is transformed into its
> long version, the simple countermeasure of using the short form is defeated.
> 

Is there anywhere a explicit usage of the short file name?
Until now it was nearly forgotten that there are short and long names.

Related to the patch: Is it correct that cygwin is case sensitive?

Peter
(Continue reading)

Enrico Forestieri | 5 Oct 21:14
Favicon

Re: BUG: jpeg capital letters (.JPG) does not work with pdflatex

On Sun, Oct 05, 2008 at 06:50:45PM +0200, Peter Kümmel wrote:

> Enrico Forestieri wrote:
> > On Sun, Oct 05, 2008 at 04:40:35PM +0200, Abdelrazak Younes wrote:
> > 
> >> On 05/10/2008 16:30, Peter K�mmel wrote:
> >>> Andre Poenitz wrote:
> >>>> On Sun, Oct 05, 2008 at 02:09:03PM +0200, Peter K�mmel wrote:
> >>>>> Abdelrazak Younes wrote:
> >>>>>> Yes, but please use (or extend) already existing 
> >>>>>> FileName::operator==()
> >>>>>>
> >>>>> FileName::operator==() expands now short names on Windows.
> >>>>> http://www.lyx.org/trac/changeset/26745
> >>>> In this case I'd prefer a more verbose name. Having non-trivial
> >>>> operations hidden in customarily "cheap" operators tend to create
> >>>> unexpected behaviour...
> >>> Or we always use long path names internaly, see patch.
> >> Yes, I prefer that.
> > 
> > Please, don't do that. Short filenames allow to overcome bugs resulting
> > from having spaces or other special characters (not only in LyX, but
> > also when using external programs). If a pathname is transformed into its
> > long version, the simple countermeasure of using the short form is defeated.
> > 
> 
> Is there anywhere a explicit usage of the short file name?
> Until now it was nearly forgotten that there are short and long names.

If I remember correctly, there's still a bug that doesn't let you save
(Continue reading)


Gmane