[jira] [Comment Edited] (FOP-2146) Wrong FontCache-Directory used for not existing userHome in FontCache.getDefaultCacheFile() (Bug 47786 was not fixed correctly)

2020-05-05 Thread Jukka Matilainen (Jira)


[ 
https://issues.apache.org/jira/browse/FOP-2146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17099923#comment-17099923
 ] 

Jukka Matilainen edited comment on FOP-2146 at 5/5/20, 3:11 PM:


I have the same problem when running on AWS Lambda.

{{FontCache.getUserHome()}} returns {{null}} if the {{user.home}} system 
property is unset or the directory pointed to by it does not exist. The latter 
seems to be the case on the AWS Lambda Java runtime.

This leads to {{FontCache.getDefaultCacheFile(true)}} returning ".fop" as the 
font-cache location, which does not work (instead of the expected 
"/tmp/.fop/fop-fonts.cache" which would work and is what would be returned if 
the home directory existed but was read-only).

The problem is that ".fop" won't work as the writable font cache location on 
AWS Lambda, since the current working directory is read-only.  In fact /tmp  
(java.io.tmpdir) directory is the only writable location.

 


was (Author: jkmatila):
I have the same problem when running on AWS Lambda.

{{FontCache.getUserHome()}} returns {{null}} if the {{user.home}} system 
property is unset or the directory pointed to by it does not exist. The latter 
seems to be the case on the AWS Lambda Java runtime.

This leads to {{FontCache.getDefaultCacheFile(true)}} returning ".fop" as the 
font-cache location, which does not work (instead of the expeced 
"/tmp/.fop/fop-fonts.cache" which would work and is what would be returned if 
the home directory existed but was read-only).

The problem is that ".fop" won't work as the writable font cache location on 
AWS Lambda, since the current working directory is read-only.  In fact /tmp  
(java.io.tmpdir) directory is the only writable location.

 

> Wrong FontCache-Directory used for not existing userHome in 
> FontCache.getDefaultCacheFile() (Bug 47786 was not fixed correctly)
> ---
>
> Key: FOP-2146
> URL: https://issues.apache.org/jira/browse/FOP-2146
> Project: FOP
>  Issue Type: Bug
>  Components: font/unqualified
>Affects Versions: 1.1
> Environment: Operating System: All
> Platform: All
>Reporter: mg
>
> Method getDefaultCacheFile() returns an invalid file name if the user has no 
> home directory set. In that case the name of the fop user directory 
> (FOP_USER_DIR!) is returned and not the name of the cache file 
> (DEFAULT_CACHE_FILENAME).
> Wrong Code:
> public static File getDefaultCacheFile(boolean forWriting) {
> File userHome = getUserHome();
> if (userHome != null) {
> File fopUserDir = new File(userHome, FOP_USER_DIR);
> if (forWriting) {
> boolean writable = fopUserDir.canWrite();
> if (!fopUserDir.exists()) {
> writable = fopUserDir.mkdir();
> }
> if (!writable) {
> userHome = getTempDirectory();
> fopUserDir = new File(userHome, FOP_USER_DIR);
> fopUserDir.mkdir();
> }
> }
> return new File(fopUserDir, DEFAULT_CACHE_FILENAME);
> }
> return new File(FOP_USER_DIR);
> }
> If getUserHome() does not return a directory the default name must be 
> returned (and not the name of the directory):
> return new File(DEFAULT_CACHE_FILENAME);



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Comment Edited] (FOP-2146) Wrong FontCache-Directory used for not existing userHome in FontCache.getDefaultCacheFile() (Bug 47786 was not fixed correctly)

2020-05-05 Thread Jukka Matilainen (Jira)


[ 
https://issues.apache.org/jira/browse/FOP-2146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17099923#comment-17099923
 ] 

Jukka Matilainen edited comment on FOP-2146 at 5/5/20, 3:10 PM:


I have the same problem when running on AWS Lambda.

{{FontCache.getUserHome()}} returns {{null}} if the {{user.home}} system 
property is unset or the directory pointed to by it does not exist. The latter 
seems to be the case on the AWS Lambda Java runtime.

This leads to {{FontCache.getDefaultCacheFile(true)}} returning ".fop" as the 
font-cache location, which does not work (instead of the expeced 
"/tmp/.fop/fop-fonts.cache" which would work and is what would be returned if 
the home directory existed but was read-only).

The problem is that ".fop" won't work as the writable font cache location on 
AWS Lambda, since the current working directory is read-only.  In fact /tmp  
(java.io.tmpdir) directory is the only writable location.

 


was (Author: jkmatila):
{{FontCache.getUserHome()}} returns {{null}} if the {{user.home}} system 
property is unset or the directory pointed to by it does not exist. The latter 
seems to be the case on the AWS Lambda Java runtime.

> Wrong FontCache-Directory used for not existing userHome in 
> FontCache.getDefaultCacheFile() (Bug 47786 was not fixed correctly)
> ---
>
> Key: FOP-2146
> URL: https://issues.apache.org/jira/browse/FOP-2146
> Project: FOP
>  Issue Type: Bug
>  Components: font/unqualified
>Affects Versions: 1.1
> Environment: Operating System: All
> Platform: All
>Reporter: mg
>
> Method getDefaultCacheFile() returns an invalid file name if the user has no 
> home directory set. In that case the name of the fop user directory 
> (FOP_USER_DIR!) is returned and not the name of the cache file 
> (DEFAULT_CACHE_FILENAME).
> Wrong Code:
> public static File getDefaultCacheFile(boolean forWriting) {
> File userHome = getUserHome();
> if (userHome != null) {
> File fopUserDir = new File(userHome, FOP_USER_DIR);
> if (forWriting) {
> boolean writable = fopUserDir.canWrite();
> if (!fopUserDir.exists()) {
> writable = fopUserDir.mkdir();
> }
> if (!writable) {
> userHome = getTempDirectory();
> fopUserDir = new File(userHome, FOP_USER_DIR);
> fopUserDir.mkdir();
> }
> }
> return new File(fopUserDir, DEFAULT_CACHE_FILENAME);
> }
> return new File(FOP_USER_DIR);
> }
> If getUserHome() does not return a directory the default name must be 
> returned (and not the name of the directory):
> return new File(DEFAULT_CACHE_FILENAME);



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Comment Edited] (FOP-2857) [PATCH] FontCache.toDirectory() and FontCache.getDefaultCacheFile() not working correctly

2020-05-05 Thread Jukka Matilainen (Jira)


[ 
https://issues.apache.org/jira/browse/FOP-2857?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17099956#comment-17099956
 ] 

Jukka Matilainen edited comment on FOP-2857 at 5/5/20, 2:54 PM:


I have the same problem: {{FontCache.getDefaultCacheFile(true)}} returns an 
unexpected value if the home directory is not set or points to a non-existing 
directory.

When running FOP in the AWS Lambda Java runtime, the {{user.home}} system 
property points to a non-existent directory and {{FontCache.getUserHome()}} 
returns {{null}} due to the existence test in {{FontCache.toDirectory()}} 
failing. 

Now when {{FontCache.getDefaultCacheFile(true)}} gets called it returns {{new 
File(".fop")}} as the font cache location instead of the expected  {{new 
File("/tmp/.fop/fop-fonts.cache")}}, which would be the return value if the 
home directory existed but was read-only.

This won't work in AWS Lambda, as the current working directory is not writable 
(in fact, /tmp directory is the only writable directory).

 


was (Author: jkmatila):
I have the same problem: {{FontCache.getDefaultCacheFile(true)}} returns an 
unexpected value if the home directory is not set points to a non-existing 
directory.

When running FOP in the AWS Lambda Java runtime, the {{user.home}} system 
property points to a non-existent directory and {{FontCache.getUserHome()}} 
returns {{null}} due to the existence test in {{FontCache.toDirectory()}} 
failing. 

Now when {{FontCache.getDefaultCacheFile(true)}} gets called it returns {{new 
File(".fop")}} as the font cache location instead of the expected  {{new 
File("/tmp/.fop/fop-fonts.cache")}}, which would be the return value if the 
home directory existed but was read-only.

This won't work in AWS Lambda, as the current working directory is not writable 
(in fact, /tmp directory is the only writable directory).

 

> [PATCH] FontCache.toDirectory() and FontCache.getDefaultCacheFile() not 
> working correctly
> -
>
> Key: FOP-2857
> URL: https://issues.apache.org/jira/browse/FOP-2857
> Project: FOP
>  Issue Type: Bug
>  Components: font/unqualified
>Affects Versions: 2.3
>Reporter: Vera Straube
>Priority: Critical
> Attachments: FontCache.java.patch, FontCache.java.patch2
>
>
> The function getDefaultCacheFile() of the class FontCache should work like 
> this:
> [1] case:   select user_dir
> -> user_dir:'C:\Users\strv'
> -> temp_dir:'C:\Users\strv\AppData\Local\Temp\'
> -> cache_file:  'C:\Users\strv\.fop\fop-fonts.cache'
> [2] case:   select temp_dir
> -> user_dir:''
> -> temp_dir:'C:\Users\strv\AppData\Local\Temp\'
> -> cache_file:  'C:\Users\strv\AppData\Local\Temp\.fop\fop-fonts.cache'
> [3] case:   select curr_dir
> -> user_dir:''
> -> temp_dir:''
> -> cache_file:  'fop-fonts.cache'
> Actually it works uncorrectly like this:
> [1] case:   select user_dir
> -> user_dir:'C:\Users\strv'
> -> temp_dir:'C:\Users\strv\AppData\Local\Temp\'
> -> cache_file:  'C:\Users\strv\.fop\fop-fonts.cache'
> [2] case:   select temp_dir
> -> user_dir:''
> -> temp_dir:'C:\Users\strv\AppData\Local\Temp\'
> -> cache_file:  '.fop'  --> wrong behavior !!!
> [3] case:   select curr_dir
> -> user_dir:''
> -> temp_dir:''
> -> cache_file:  '.fop'  --> wrong behavior !!!



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Comment Edited] (FOP-2857) [PATCH] FontCache.toDirectory() and FontCache.getDefaultCacheFile() not working correctly

2020-05-05 Thread Jukka Matilainen (Jira)


[ 
https://issues.apache.org/jira/browse/FOP-2857?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17099956#comment-17099956
 ] 

Jukka Matilainen edited comment on FOP-2857 at 5/5/20, 2:53 PM:


I have the same problem. {{FontCache.getDefaultCacheFile(true) }}returns an 
unexpected value if the home directory is not set points to a non-existing 
directory.

When running FOP in the AWS Lambda Java runtime, the {{user.home}} system 
property points to a non-existent directory and {{FontCache.getUserHome()}} 
returns {{null}} due to the existence test in {{FontCache.toDirectory()}} 
failing. 

Now when {{FontCache.getDefaultCacheFile(true)}} gets called it returns {{new 
File(".fop")}} as the font cache location instead of the expected  {{new 
File("/tmp/.fop/fop-fonts.cache")}}, which would be the return value if the 
home directory existed but was read-only.

This won't work in AWS Lambda, as the current working directory is not writable 
(in fact, /tmp directory is the only writable directory).

 


was (Author: jkmatila):
I have the same problem.

When running FOP in the AWS Lambda Java runtime, the {{user.home}} system 
property points to a non-existent directory and {{FontCache.getUserHome()}} 
returns {{null}} due to the existence test in {{FontCache.toDirectory()}} 
failing. 

Now when {{FontCache.getDefaultCacheFile(true)}} gets called it returns {{new 
File(".fop")}} as the font cache location instead of the expected  {{new 
File("/tmp/.fop/fop-fonts.cache").}}

This won't work in AWS Lambda, as the current working directory is not writable 
(in fact, /tmp directory is the only writable directory).

 

> [PATCH] FontCache.toDirectory() and FontCache.getDefaultCacheFile() not 
> working correctly
> -
>
> Key: FOP-2857
> URL: https://issues.apache.org/jira/browse/FOP-2857
> Project: FOP
>  Issue Type: Bug
>  Components: font/unqualified
>Affects Versions: 2.3
>Reporter: Vera Straube
>Priority: Critical
> Attachments: FontCache.java.patch, FontCache.java.patch2
>
>
> The function getDefaultCacheFile() of the class FontCache should work like 
> this:
> [1] case:   select user_dir
> -> user_dir:'C:\Users\strv'
> -> temp_dir:'C:\Users\strv\AppData\Local\Temp\'
> -> cache_file:  'C:\Users\strv\.fop\fop-fonts.cache'
> [2] case:   select temp_dir
> -> user_dir:''
> -> temp_dir:'C:\Users\strv\AppData\Local\Temp\'
> -> cache_file:  'C:\Users\strv\AppData\Local\Temp\.fop\fop-fonts.cache'
> [3] case:   select curr_dir
> -> user_dir:''
> -> temp_dir:''
> -> cache_file:  'fop-fonts.cache'
> Actually it works uncorrectly like this:
> [1] case:   select user_dir
> -> user_dir:'C:\Users\strv'
> -> temp_dir:'C:\Users\strv\AppData\Local\Temp\'
> -> cache_file:  'C:\Users\strv\.fop\fop-fonts.cache'
> [2] case:   select temp_dir
> -> user_dir:''
> -> temp_dir:'C:\Users\strv\AppData\Local\Temp\'
> -> cache_file:  '.fop'  --> wrong behavior !!!
> [3] case:   select curr_dir
> -> user_dir:''
> -> temp_dir:''
> -> cache_file:  '.fop'  --> wrong behavior !!!



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Comment Edited] (FOP-2857) [PATCH] FontCache.toDirectory() and FontCache.getDefaultCacheFile() not working correctly

2020-05-05 Thread Jukka Matilainen (Jira)


[ 
https://issues.apache.org/jira/browse/FOP-2857?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17099956#comment-17099956
 ] 

Jukka Matilainen edited comment on FOP-2857 at 5/5/20, 2:53 PM:


I have the same problem: {{FontCache.getDefaultCacheFile(true)}} returns an 
unexpected value if the home directory is not set points to a non-existing 
directory.

When running FOP in the AWS Lambda Java runtime, the {{user.home}} system 
property points to a non-existent directory and {{FontCache.getUserHome()}} 
returns {{null}} due to the existence test in {{FontCache.toDirectory()}} 
failing. 

Now when {{FontCache.getDefaultCacheFile(true)}} gets called it returns {{new 
File(".fop")}} as the font cache location instead of the expected  {{new 
File("/tmp/.fop/fop-fonts.cache")}}, which would be the return value if the 
home directory existed but was read-only.

This won't work in AWS Lambda, as the current working directory is not writable 
(in fact, /tmp directory is the only writable directory).

 


was (Author: jkmatila):
I have the same problem. {{FontCache.getDefaultCacheFile(true) }}returns an 
unexpected value if the home directory is not set points to a non-existing 
directory.

When running FOP in the AWS Lambda Java runtime, the {{user.home}} system 
property points to a non-existent directory and {{FontCache.getUserHome()}} 
returns {{null}} due to the existence test in {{FontCache.toDirectory()}} 
failing. 

Now when {{FontCache.getDefaultCacheFile(true)}} gets called it returns {{new 
File(".fop")}} as the font cache location instead of the expected  {{new 
File("/tmp/.fop/fop-fonts.cache")}}, which would be the return value if the 
home directory existed but was read-only.

This won't work in AWS Lambda, as the current working directory is not writable 
(in fact, /tmp directory is the only writable directory).

 

> [PATCH] FontCache.toDirectory() and FontCache.getDefaultCacheFile() not 
> working correctly
> -
>
> Key: FOP-2857
> URL: https://issues.apache.org/jira/browse/FOP-2857
> Project: FOP
>  Issue Type: Bug
>  Components: font/unqualified
>Affects Versions: 2.3
>Reporter: Vera Straube
>Priority: Critical
> Attachments: FontCache.java.patch, FontCache.java.patch2
>
>
> The function getDefaultCacheFile() of the class FontCache should work like 
> this:
> [1] case:   select user_dir
> -> user_dir:'C:\Users\strv'
> -> temp_dir:'C:\Users\strv\AppData\Local\Temp\'
> -> cache_file:  'C:\Users\strv\.fop\fop-fonts.cache'
> [2] case:   select temp_dir
> -> user_dir:''
> -> temp_dir:'C:\Users\strv\AppData\Local\Temp\'
> -> cache_file:  'C:\Users\strv\AppData\Local\Temp\.fop\fop-fonts.cache'
> [3] case:   select curr_dir
> -> user_dir:''
> -> temp_dir:''
> -> cache_file:  'fop-fonts.cache'
> Actually it works uncorrectly like this:
> [1] case:   select user_dir
> -> user_dir:'C:\Users\strv'
> -> temp_dir:'C:\Users\strv\AppData\Local\Temp\'
> -> cache_file:  'C:\Users\strv\.fop\fop-fonts.cache'
> [2] case:   select temp_dir
> -> user_dir:''
> -> temp_dir:'C:\Users\strv\AppData\Local\Temp\'
> -> cache_file:  '.fop'  --> wrong behavior !!!
> [3] case:   select curr_dir
> -> user_dir:''
> -> temp_dir:''
> -> cache_file:  '.fop'  --> wrong behavior !!!



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Comment Edited] (FOP-2857) [PATCH] FontCache.toDirectory() and FontCache.getDefaultCacheFile() not working correctly

2020-05-05 Thread Jukka Matilainen (Jira)


[ 
https://issues.apache.org/jira/browse/FOP-2857?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17099956#comment-17099956
 ] 

Jukka Matilainen edited comment on FOP-2857 at 5/5/20, 2:37 PM:


I have the same problem.

When running FOP in the AWS Lambda Java runtime, the {{user.home}} system 
property points to a non-existent directory and {{FontCache.getUserHome()}} 
returns {{null}} due to the existence test in {{FontCache.toDirectory()}} 
failing. 

Now when {{FontCache.getDefaultCacheFile(true)}} gets called it returns {{new 
File(".fop")}} as the font cache location instead of the expected  {{new 
File("/tmp/.fop/fop-fonts.cache").}}

This won't work in AWS Lambda, as the current working directory is not writable 
(in fact, /tmp directory is the only writable directory).

 


was (Author: jkmatila):
I have the same problem.

When running FOP in the AWS Lambda Java runtime, the {{user.home}} system 
property points to a non-existent directory and {{FontCache.getUserHome()}} 
returns {{null}} due to the existence test in {{FontCache.toDirectory()}} 
failing. 

Now when {{FontCache.getDefaultCacheFile(true)}} gets called it returns {{new 
File(".fop")}} as the font cache location instead the expected  {{new 
File("/tmp/.fop/fop-fonts.cache").}}

This won't work in AWS Lambda, as the current working directory is not writable 
(in fact, /tmp directory is the only writable directory..

 

> [PATCH] FontCache.toDirectory() and FontCache.getDefaultCacheFile() not 
> working correctly
> -
>
> Key: FOP-2857
> URL: https://issues.apache.org/jira/browse/FOP-2857
> Project: FOP
>  Issue Type: Bug
>  Components: font/unqualified
>Affects Versions: 2.3
>Reporter: Vera Straube
>Priority: Critical
> Attachments: FontCache.java.patch, FontCache.java.patch2
>
>
> The function getDefaultCacheFile() of the class FontCache should work like 
> this:
> [1] case:   select user_dir
> -> user_dir:'C:\Users\strv'
> -> temp_dir:'C:\Users\strv\AppData\Local\Temp\'
> -> cache_file:  'C:\Users\strv\.fop\fop-fonts.cache'
> [2] case:   select temp_dir
> -> user_dir:''
> -> temp_dir:'C:\Users\strv\AppData\Local\Temp\'
> -> cache_file:  'C:\Users\strv\AppData\Local\Temp\.fop\fop-fonts.cache'
> [3] case:   select curr_dir
> -> user_dir:''
> -> temp_dir:''
> -> cache_file:  'fop-fonts.cache'
> Actually it works uncorrectly like this:
> [1] case:   select user_dir
> -> user_dir:'C:\Users\strv'
> -> temp_dir:'C:\Users\strv\AppData\Local\Temp\'
> -> cache_file:  'C:\Users\strv\.fop\fop-fonts.cache'
> [2] case:   select temp_dir
> -> user_dir:''
> -> temp_dir:'C:\Users\strv\AppData\Local\Temp\'
> -> cache_file:  '.fop'  --> wrong behavior !!!
> [3] case:   select curr_dir
> -> user_dir:''
> -> temp_dir:''
> -> cache_file:  '.fop'  --> wrong behavior !!!



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (FOP-2857) [PATCH] FontCache.toDirectory() and FontCache.getDefaultCacheFile() not working correctly

2020-05-05 Thread Jukka Matilainen (Jira)


[ 
https://issues.apache.org/jira/browse/FOP-2857?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17099956#comment-17099956
 ] 

Jukka Matilainen commented on FOP-2857:
---

I have the same problem.

When running FOP in the AWS Lambda Java runtime, the {{user.home}} system 
property points to a non-existent directory and {{FontCache.getUserHome()}} 
returns {{null}} due to the existence test in {{FontCache.toDirectory()}} 
failing. 

Now when {{FontCache.getDefaultCacheFile(true)}} gets called it returns {{new 
File(".fop")}} as the font cache location instead the expected  {{new 
File("/tmp/.fop/fop-fonts.cache").}}

This won't work in AWS Lambda, as the current working directory is not writable 
(in fact, /tmp directory is the only writable directory..

 

> [PATCH] FontCache.toDirectory() and FontCache.getDefaultCacheFile() not 
> working correctly
> -
>
> Key: FOP-2857
> URL: https://issues.apache.org/jira/browse/FOP-2857
> Project: FOP
>  Issue Type: Bug
>  Components: font/unqualified
>Affects Versions: 2.3
>Reporter: Vera Straube
>Priority: Critical
> Attachments: FontCache.java.patch, FontCache.java.patch2
>
>
> The function getDefaultCacheFile() of the class FontCache should work like 
> this:
> [1] case:   select user_dir
> -> user_dir:'C:\Users\strv'
> -> temp_dir:'C:\Users\strv\AppData\Local\Temp\'
> -> cache_file:  'C:\Users\strv\.fop\fop-fonts.cache'
> [2] case:   select temp_dir
> -> user_dir:''
> -> temp_dir:'C:\Users\strv\AppData\Local\Temp\'
> -> cache_file:  'C:\Users\strv\AppData\Local\Temp\.fop\fop-fonts.cache'
> [3] case:   select curr_dir
> -> user_dir:''
> -> temp_dir:''
> -> cache_file:  'fop-fonts.cache'
> Actually it works uncorrectly like this:
> [1] case:   select user_dir
> -> user_dir:'C:\Users\strv'
> -> temp_dir:'C:\Users\strv\AppData\Local\Temp\'
> -> cache_file:  'C:\Users\strv\.fop\fop-fonts.cache'
> [2] case:   select temp_dir
> -> user_dir:''
> -> temp_dir:'C:\Users\strv\AppData\Local\Temp\'
> -> cache_file:  '.fop'  --> wrong behavior !!!
> [3] case:   select curr_dir
> -> user_dir:''
> -> temp_dir:''
> -> cache_file:  '.fop'  --> wrong behavior !!!



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Comment Edited] (FOP-2146) Wrong FontCache-Directory used for not existing userHome in FontCache.getDefaultCacheFile() (Bug 47786 was not fixed correctly)

2020-05-05 Thread Jukka Matilainen (Jira)


[ 
https://issues.apache.org/jira/browse/FOP-2146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17099923#comment-17099923
 ] 

Jukka Matilainen edited comment on FOP-2146 at 5/5/20, 2:09 PM:


{{FontCache.getUserHome()}} returns {{null}} if the {{user.home}} system 
property is unset or the directory pointed to by it does not exist. The latter 
seems to be the case on the AWS Lambda Java runtime.


was (Author: jkmatila):
FontCache.g{{etUserHome()}} method returns {{null}} if the {{user.home}} system 
property is unset or the directory pointed to by it does not exist. The latter 
seems to be the case on the AWS Lambda Java runtime.

> Wrong FontCache-Directory used for not existing userHome in 
> FontCache.getDefaultCacheFile() (Bug 47786 was not fixed correctly)
> ---
>
> Key: FOP-2146
> URL: https://issues.apache.org/jira/browse/FOP-2146
> Project: FOP
>  Issue Type: Bug
>  Components: font/unqualified
>Affects Versions: 1.1
> Environment: Operating System: All
> Platform: All
>Reporter: mg
>
> Method getDefaultCacheFile() returns an invalid file name if the user has no 
> home directory set. In that case the name of the fop user directory 
> (FOP_USER_DIR!) is returned and not the name of the cache file 
> (DEFAULT_CACHE_FILENAME).
> Wrong Code:
> public static File getDefaultCacheFile(boolean forWriting) {
> File userHome = getUserHome();
> if (userHome != null) {
> File fopUserDir = new File(userHome, FOP_USER_DIR);
> if (forWriting) {
> boolean writable = fopUserDir.canWrite();
> if (!fopUserDir.exists()) {
> writable = fopUserDir.mkdir();
> }
> if (!writable) {
> userHome = getTempDirectory();
> fopUserDir = new File(userHome, FOP_USER_DIR);
> fopUserDir.mkdir();
> }
> }
> return new File(fopUserDir, DEFAULT_CACHE_FILENAME);
> }
> return new File(FOP_USER_DIR);
> }
> If getUserHome() does not return a directory the default name must be 
> returned (and not the name of the directory):
> return new File(DEFAULT_CACHE_FILENAME);



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (FOP-2146) Wrong FontCache-Directory used for not existing userHome in FontCache.getDefaultCacheFile() (Bug 47786 was not fixed correctly)

2020-05-05 Thread Jukka Matilainen (Jira)


[ 
https://issues.apache.org/jira/browse/FOP-2146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17099923#comment-17099923
 ] 

Jukka Matilainen commented on FOP-2146:
---

FontCache.g{{etUserHome()}} method returns {{null}} if the {{user.home}} system 
property is unset or the directory pointed to by it does not exist. The latter 
seems to be the case on the AWS Lambda Java runtime.

> Wrong FontCache-Directory used for not existing userHome in 
> FontCache.getDefaultCacheFile() (Bug 47786 was not fixed correctly)
> ---
>
> Key: FOP-2146
> URL: https://issues.apache.org/jira/browse/FOP-2146
> Project: FOP
>  Issue Type: Bug
>  Components: font/unqualified
>Affects Versions: 1.1
> Environment: Operating System: All
> Platform: All
>Reporter: mg
>
> Method getDefaultCacheFile() returns an invalid file name if the user has no 
> home directory set. In that case the name of the fop user directory 
> (FOP_USER_DIR!) is returned and not the name of the cache file 
> (DEFAULT_CACHE_FILENAME).
> Wrong Code:
> public static File getDefaultCacheFile(boolean forWriting) {
> File userHome = getUserHome();
> if (userHome != null) {
> File fopUserDir = new File(userHome, FOP_USER_DIR);
> if (forWriting) {
> boolean writable = fopUserDir.canWrite();
> if (!fopUserDir.exists()) {
> writable = fopUserDir.mkdir();
> }
> if (!writable) {
> userHome = getTempDirectory();
> fopUserDir = new File(userHome, FOP_USER_DIR);
> fopUserDir.mkdir();
> }
> }
> return new File(fopUserDir, DEFAULT_CACHE_FILENAME);
> }
> return new File(FOP_USER_DIR);
> }
> If getUserHome() does not return a directory the default name must be 
> returned (and not the name of the directory):
> return new File(DEFAULT_CACHE_FILENAME);



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (FOP-2544) Incorrect pdf rendering from FO with embedded svg via java embedding

2016-12-30 Thread Jukka Matilainen (JIRA)

[ 
https://issues.apache.org/jira/browse/FOP-2544?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15787888#comment-15787888
 ] 

Jukka Matilainen commented on FOP-2544:
---

This bug can be reproduced with FOP 2.1 by enabling debug level logging. When 
running with DEBUG log level enabled, all characters in SVG text are rendered 
with an outlining gray rectangle.

Can be reproduced for example by running from the command line like this:
{code}
FOP_OPTS="-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog
 -Dorg.apache.commons.logging.simplelog.defaultlog=DEBUG" fop -fo helloworld.fo 
-pdf helloworld.pdf
{code}

The problem appears to in org/apache/fop/svg/NativeTextPainter.java:118

http://svn.apache.org/viewvc/xmlgraphics/fop/tags/fop-2_1/src/java/org/apache/fop/svg/NativeTextPainter.java?view=annotate#l118





> Incorrect pdf rendering from FO with embedded svg via java embedding
> 
>
> Key: FOP-2544
> URL: https://issues.apache.org/jira/browse/FOP-2544
> Project: FOP
>  Issue Type: Bug
>  Components: foreign/svg, image/svg, renderer/svg
>Affects Versions: 2.0
>Reporter: Piotr Stefańczyk
> Attachments: 35ca62e7-238c-44c2-bb54-c83e1fc548c8.pdf, fop.xconf, 
> helloworld.fo
>
>
> I have problem with rendering pdf with embedded svg. When I render pdf from 
> command line everything is OK, but if I render fo programmatically then text 
> within svg is incorrect rendered. Every char have grey rectangle.
> I was trying render in version 1.1 programmatically and fo is correct 
> rendered to pdf.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)