Re: [dbutils] Please update commons-dbutils 1.8 in Maven central repo

2022-03-24 Thread Bruno P. Kinoshita
 Hi Eric,
The master branch has been updated but not released yet. I saw a 1.8RC2 tag, so 
I think a vote might have been cancelled/postponed due to some issues.
You can use the latest version until 1.8 is released. Since the whole Apache 
Commons is run by volunteers, the next release depends on someone have time to 
read the archives, see why RC2 was not released, then go over recent activity, 
check what else needs to be done, and prepare a RC3.
Cheers
Bruno

On Friday, 25 March 2022, 09:56:19 am NZDT, Liu, Yufei (Eric) 
 wrote:  
 
 Hi,

I noticed that on Github[1], commons-dbutils mentioned a 1.8 release in 
README.md .
But in the maven central repo, the version is not published. And the 
version 1.8 is also not on the download page.
According to release notes[4]: in version 1.8, a 
ConcurrentModificationException was fixed in DBUTILS-135. I believe this 
is quite important.

Would you please release version 1.8 into release channels including maven?

[1] https://github.com/apache/commons-dbutils
[2] https://mvnrepository.com/artifact/commons-dbutils/commons-dbutils
[3] https://github.com/apache/commons-dbutils/pull/3
[4] https://github.com/apache/commons-dbutils/blob/master/RELEASE-NOTES.txt

-- 
Eric Liu


-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org

  

Re: [compress] LZ4 compression taking excessively long

2022-01-19 Thread Bruno P. Kinoshita
 Hello,
I reproduced your test case. It completed when running without the debugger:


But with the debugger it didn't finish in a couple minutes so I killed it. Then 
going through the code, it really takes a long time in the finish() method. 
There are a few loops that could be the reason for the problem (e.g. 
https://github.com/apache/commons-compress/blob/6aacb2953d03b9423057f176e6d4cbe6dca65b3d/src/main/java/org/apache/commons/compress/compressors/lz77support/LZ77Compressor.java#L421)
 and also some LZ77 parameters that could speed up the compression.

I am not really that familiar with the [compress] code base. But if you create 
a JIRA issue, someone else might be able to help investigating this issue. I 
will try to take a look if someday I find time to work on [compress]. Since we 
have another library to compare, it shouldn't be too hard to figure out what's 
wrong, and compare the performance of the two libraries.

Thanks!
-Bruno


On Saturday, 15 January 2022, 09:50:09 am NZDT, Mark Raynsford 
 wrote:  
 
 Hello!

I've run into an issue when trying to use the
FramedLZ4CompressorOutputStream class in commons-compress 1.21.

I've put together a small repro case here:

  https://github.com/io7m/commons-compress-20220114

If you run the BadCompress class, it will attempt to open
and compress the given 2097152 byte file. What seems to happen is that
the code goes into an excessively long loop after the finish() method
is called.

The standard lz4 command-line tool doesn't have any problems with the
input:

$ time lz4 bad-compress.bin 
Compressed filename will be : bad-compress.bin.lz4 
Compressed 2097152 bytes into 589156 bytes ==> 28.09%
real    0m0.005s
user    0m0.003s
sys    0m0.003s

I've yet to see the BadCompress example actually finish executing...

Is there something I'm doing wrong? I've tried, for example,
submitting 2097152 bytes as chunks of 4096 bytes, but it makes
no difference.

-- 
Mark Raynsford | https://www.io7m.com

  

Re: Sanselan support for writing IPTC fields

2022-01-07 Thread Bruno P. Kinoshita
 Hi Ted,

Thanks for providing useful background, and sample code. From what I could 
understand, we would need to figure out where this File Property title is 
coming from, if not from XPTITLE (or it could be derived from XPTITLE combining 
with another field...).

Shouldn't be too hard to fix. For issues like this, the hardest part if finding 
a specification or documentation that explains things (or worse when we find 
docs that contradict each other :). Oh, and also finding example images.

Could you create a JIRA for this, please? If you have small images that can be 
added to the project, then we can use these when writing unit tests too.

Cheers
Bruno

On Saturday, 8 January 2022, 06:17:37 am NZDT, 
ted.carr...@btinternet.com.INVALID  wrote:  
 
 I have been looking into this area and been a bit puzzled by what is
happening.  Something strange happens with the Title and Subject fields on
Windows when writing IPTC fields (while this is slightly outside the scope
of Apache Imaging, there is a related issue with how Apache Imaging updates
the Windows Title field – see later.)

 

There is a difference between the Title “File Property” (available in
Windows display),and the XPTITLE(MicrosoftTagConstants.EXIF_TAG_XPTITLE)
metadata field in EXIF. Windows is deciding what to put in File Properties –
it is not a straight mapping between fields and properties. 

 

(I am using ICAFE to write IPTC fields and then using Apache Imaging for the
EXIF fields.)  When the IPTC field Caption / Description field is written,
and the Title Property is currently blank , then Windows (I believe),
decides to put the Caption / Description  into the Title “File Property” for
Windows, not the Subject field.  If Title File Property is not blank, then
the Caption / Description is written to the Subject File Property, as
expected.  

So if you update the  IPTC OBJECT_NAME and CAPTION/DESCRIPTION, it is
possible get CAPTION/DESCRIPTION in both fields – I think this is what you
are seeing. 

 

I think this is related to an Apache Imaging issue that it is not possible
to overwrite the Windows Title “File Property” using Apache Imaging, if
there is already a value present in the Title “File Property”. It appears
that updating XPTITLE(MicrosoftTagConstants.EXIF_TAG_XPTITLE) through Apache
Imaging does not trigger an update of the Title “File Property”.  The result
with be a File with the XPTITLE metadata which differs from the Title
showing in Windows.  It is very easy to test this using sample code e.g.
(I will raise an issue on Jira – depending on feedback on this point.)

 

/**

    *  

    * @param jpegImageFile - source image file

    * @param dst - destination image file

    * @throws IOException - IO exception

    * @throws ImageReadException - Read exception

    * @throws ImageWriteException - write exception

    */

    public static boolean updateWindowsFields(final File jpegImageFile,
final File dst)

            throws IOException, ImageReadException, ImageWriteException {

 

        try (FileOutputStream fos = new FileOutputStream(dst);

            OutputStream os = new BufferedOutputStream(fos)) {

            TiffOutputSet outputSet = null;

            // note that metadata might be null if no metadata is found.

            final ImageMetadata metadata =
Imaging.getMetadata(jpegImageFile);

            final JpegImageMetadata jpegMetadata = (JpegImageMetadata)
metadata;

            if (null != jpegMetadata) {

                // note that exif might be null if no Exif metadata is
found.

                final TiffImageMetadata exif = jpegMetadata.getExif();

                if (null != exif) {

                    outputSet = exif.getOutputSet();

                }

            }

 

            // if file does not contain any exif metadata, we create an
empty

            // set of exif metadata. Otherwise, we keep all of the other

            // existing tags.

            if (null == outputSet) {

                outputSet = new TiffOutputSet();

            }

 

            final TiffOutputDirectory rootDir =
outputSet.getOrCreateRootDirectory();

            rootDir.removeField(MicrosoftTagConstants.EXIF_TAG_XPTITLE);

            rootDir.add(MicrosoftTagConstants.EXIF_TAG_XPTITLE, "new
title");

 

            rootDir.removeField(MicrosoftTagConstants.EXIF_TAG_XPSUBJECT);

            rootDir.add(MicrosoftTagConstants.EXIF_TAG_XPSUBJECT, "new
subject");

            //

            rootDir.removeField(MicrosoftTagConstants.EXIF_TAG_XPCOMMENT);

          rootDir.add(MicrosoftTagConstants.EXIF_TAG_XPCOMMENT, "new
comment");

            //

            rootDir.removeField(MicrosoftTagConstants.EXIF_TAG_XPKEYWORDS);

            rootDir.add(MicrosoftTagConstants.EXIF_TAG_XPKEYWORDS,
"key1;key2");

            //

            rootDir.removeField(MicrosoftTagConstants.EXIF_TAG_RATING);

            rootDir.add(MicrosoftTagConstants.EXIF_TAG_RATING, (short) 4);

            //

            

Re: [csv] Does the library provide means to circumvent CSV injection

2021-11-11 Thread Bruno P. Kinoshita
 Maybe we could provide a flag that disables the characters mentioned in the 
OWASP page about CSV Injection [1]
Normally I suggest going secure by default, but in this case I think the flag 
should be disabled by default, as filtering cells that start with "equals to" 
could break in cases where it was used for a legit formula for 
excel/openoffice/libreoffice/etc.
The OWASP page also acknowledges the difficulty of this issue I think:
> This attack is difficult to mitigate, and explicitly disallowed fromquite a 
> few bug bounty programs.
Just my 0.02 cents.
Bruno

[1] https://owasp.org/www-community/attacks/CSV_Injection
On Friday, 12 November 2021, 04:29:42 am NZDT, Bernd Eckenfels 
 wrote:  
 
 Hello,

I don’t really agree, a generic CSV tool should have a flag to protect against 
this, since it is a very common requirement. The situation is very unfortunate, 
this is why there is no good solution by default, but I can asume many software 
vendors working in the area of windows based enterprise desktops and exporting 
files with CSV downloads want to enable this.

Having said that, not sure if actually quoting is enough and all should prefer 
xml based office formats anyway.

I won’t mind to accept a tester patch for such an option. Maybe even 
unsafe-pass-default/quote-injection/reject-injection enum.

Gruss
Bernd


--
http://bernd.eckenfels.net

Von: sebb 
Gesendet: Thursday, November 11, 2021 3:42:08 PM
An: Commons Users List 
Cc: Gary Gregory ; ms...@acm.org 
Betreff: Re: [csv] Does the library provide means to circumvent CSV injection

On Thu, 11 Nov 2021 at 11:36, P. Ottlinger  wrote:
>
> Hi guys,
>
> thanks for your reply.
>
> Maybe I'm misinterpreting something but I thought that it could be made
> possible to configure CSVFormat-object when writing the CSV data in a
> way that any data with possibly corrupting values (as shown on the OWASP
> page) will mask the whole contents of the cell.
>
> Thus a library such as commons-csv would be able to lower the risk for
> CSV injection and not every client/customer would have to manually
> create this protecting logic.
>
> To my mind it's a simple parser for "dangerous" tokens that quotes the
> given data with additional   as we do not need to write
> functioning Excel formulas into CSV.
>
> WDYT?

As the others have said, this is the wrong place to be looking to fix
the problem.

CSV files are used for lots of things other than spreadsheets, so what
is dangerous in one application might be essential in another.

Besides, not all CSV files will be processed by Commons CSV on their
route to a spreadsheet app.

Such checks need to be made at the input to the application that processes it.

> Cheers,
> Phil
>
> Am 10.11.21 um 20:53 schrieb Gary Gregory:
> > I agree with Matt. CSV is just a container, it doesn't know or care what
> > the concept of a "formula" is.
> >
> > Gary
>

-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org

  

Re: [codec] DigestUtils / NoClassDefFoundError

2021-11-05 Thread Bruno P. Kinoshita
 Hi,
Since you mentioned it compiles fine, I guess this:

>Might this be due to a missing dependency ?
+1 you might have to confirm you have commons-codec available at runtime.
CheersBruno


On Saturday, 6 November 2021, 12:23:28 am NZDT, Vandewalle, Francois (GE 
Power)  wrote:  
 
 Hi !

I am developing with Java 11 (OpenJDK) and have the following runtime problem 
when calling DBUtils.md5Hex()
Exception in thread "Thread-0" java.lang.NoClassDefFoundError: 
org/apache/commons/codec/digest/DigestUtils

The purpose of my code is very classical: a history-aware save function, which 
only overwrites a file when the content to save differs from the content in the 
existing file (see below).

Surprisingly, compilation works fine.

Does apache commons codec support Java 11 ?
Am I doing something wrong ?
Might this be due to a missing dependency ?


Best regards,

François Vandewalle


    public boolean save(String target_file_name){
        try {
            // Check whether the file changed by comparing MD5 hashes
            String md5_existing_file = "";
            try (InputStream in = new FileInputStream(target_file_name)) {
                md5_existing_file = DigestUtils.md5Hex(in);
            }
            String md5_new_content;
            md5_new_content = DigestUtils.md5Hex(file_content);

            if (!md5_new_content.equals(md5_existing_file)){
                try (BufferedWriter out = new BufferedWriter(new 
FileWriter(target_file_name, false))) {
                    try {
                        out.write(file_content);
                    }
                    catch (IOException ioEx) {
                    }
                }
            }
        }
        catch (IOException ioEx){

        }

        return true;
    }

François Vandewalle
Systems Engineer / Development & Automation
GE Power
Power Conversion
T +49 30 7622 3818
F +49 30 7622 3737
francois.vandewa...@ge.com
www.gepowerconversion.com

Culemeyerstraße 1 | 12277 Berlin, Germany

GE Energy Power Conversion GmbH
Geschäftsführung: Jörg Nuttelmann, Martin Fleischer; Aufsichtsratsvorsitz: 
Wolfgang Dierker
Registergericht: Berlin-Charlottenburg; HRB 121288; USt-IdNr.: DE 269448104

Diese E-Mail und alle Daten, die darin übertragen werden, sind vertraulich und 
allein für den Adressaten
bestimmt. Falls Sie diese E-Mail irrtümlich erhalten, bitten wir um Mitteilung 
und darum, sie vollständig
von Ihrem Computer zu löschen.

This e-mail and any files transmitted with it are confidential and solely for 
the use of the individual or
entity to whom they are intended. If you have received this e-mail in error 
please notify the sender either
by telephone or by e-mail and delete the material from any computer.


  

Re: [text] String substitution doesn't work with empty prefix and suffix

2020-09-30 Thread Bruno P. Kinoshita
 >Note: The Javadoc says the var markers must not be null. So we could document 
 >null and empty as the same.

+1

I think it doesn't make much sense, and I think it also doesn't work. Maybe we 
should allow only for non-empty prefix/sufix?


Bruno

On Thursday, 1 October 2020, 11:57:46 am NZDT, Gary Gregory 
 wrote:  
 
 Note: The Javadoc says the var markers must not be null. So we could document 
null and empty as the same.
The first question I have is how does this even make sense, both the start and 
end markers are empty strings... so... that matches each character in input 
since "a" starts with "" and ends with ""?
Gary
On Wed, Sep 30, 2020 at 6:46 PM Bruno P. Kinoshita  wrote:

 Hi,
I reproduced the same behaviour on master branch of [text]. And indeed, found 
nothing in the javadoc that says what is the expected behaviour.
I think the class javadoc, as well as the setter javadoc would be good places 
to have such a documentation.
Let's see what others think about it, but if there are no objections, then we 
would need a JIRA issue to track this change (and pull requests would be 
welcome as well :)

Thanks!Bruno


    On Thursday, 1 October 2020, 10:49:52 am NZDT, Thomas Auinger 
 wrote:  

 Hi,



I can run the following test without exception but it doesn't yield the
expected result. Also I can find no information that prefix and or suffix
must not be empty.



@Test
public void testNoPrefixAndSuffix() {
    final Map map = new HashMap<>();
    map.put("name", "commons");
    assertEqualsCharSeq("Hi commons!", StringSubstitutor.replace("Hi name!",
map, "", ""));
}



Is that a bug?



Cheers

Thomas



  
  

Re: [text] String substitution doesn't work with empty prefix and suffix

2020-09-30 Thread Bruno P. Kinoshita
 Hi,
I reproduced the same behaviour on master branch of [text]. And indeed, found 
nothing in the javadoc that says what is the expected behaviour.
I think the class javadoc, as well as the setter javadoc would be good places 
to have such a documentation.
Let's see what others think about it, but if there are no objections, then we 
would need a JIRA issue to track this change (and pull requests would be 
welcome as well :)

Thanks!Bruno


On Thursday, 1 October 2020, 10:49:52 am NZDT, Thomas Auinger 
 wrote:  
 
 Hi,

 

I can run the following test without exception but it doesn't yield the
expected result. Also I can find no information that prefix and or suffix
must not be empty.

 

@Test
public void testNoPrefixAndSuffix() {
    final Map map = new HashMap<>();
    map.put("name", "commons");
    assertEqualsCharSeq("Hi commons!", StringSubstitutor.replace("Hi name!",
map, "", ""));
}

 

Is that a bug?

 

Cheers

Thomas

 

  

[ANNOUNCEMENT] Apache Commons Imaging 1.0-alpha2 Released

2020-08-07 Thread Bruno P. Kinoshita
The Apache Commons Imaging team is pleased to announce the 
commons-imaging-1.0-alpha2 release!

Apache Commons Imaging (previously Sanselan) is a pure-Java image library.

There are breaking changes between 1.0-alpha1 and 1.0-alpha2, until we 
stabilize the API for our 1.0 release.
Users are encouraged to read the release notes when updating to this new 
release.

For details of the fixes and new features please see:

https://www.apache.org/dist/commons/imaging/RELEASE-NOTES.txt

[These are also included with the binary and source archives]

The changes are also available at:
https://commons.apache.org/imaging/changes-report.html

Binary and source archives are available from:

https://commons.apache.org/proper/commons-imaging/download_imaging.cgi

Please see the Apache Commons Imaging website for full details:

https://commons.apache.org/imaging/

The Maven coordinates are:

    org.apache.commons
    commons-imaging
    1.0-alpha2

Changes in this version include:

New features:
o IMAGING-248:  ICNS: missing element types; some safety checks Thanks to Greg 
Shrago.
o IMAGING-245:  Add disposal method to GIF metadata Thanks to Christoffer 
Rydberg.
o IMAGING-146:  Add documentation for the color package
o IMAGING-244:  Use isEmpty instead of comparing size() with integers
o IMAGING-243:  PNG Writer Indexed Color with semi-transparent Pixels and 
Better Compression Thanks to Andreas Menze.
o IMAGING-239:  Add inflate (deflate algorithm) to TIFF files Thanks to Paul 
Austin.
o IMAGING-164:  Simplify code in IcoImageParser::writeImage Thanks to Michael 
Groß.
o IMAGING-165:  Add the fields from TiffReader.Collector to TiffContents Thanks 
to Michael Groß.
o IMAGING-228:  Remove private method PhotometricInterpreterLogLuv#cube by 
Math.pow
o IMAGING-236:  Add support to read multiple images from GIF Thanks to 
Christoffer Rydberg.

Fixed Bugs:
o IMAGING-247:  Fix crash when reading TIFF using PackBits Thanks to Gary Lucas.
o IMAGING-246:  Invalid Block Size error prevents handling of block 1084, 
Macintosh NSPrintInfo
o IMAGING-163:  Add XmpEmbedabble interface to parsers that support it
o IMAGING-151:  ColorGroup.color_counts is mutable public List and is multiply 
sorted
o IMAGING-242:  Upgrade to JUnit 5
o IMAGING-241:  Copy byte arrays fixing TODO markers
o IMAGING-136:  Imaging.getImageInfo() fails to read JPEG file Thanks to 
Michael Groß.
o IMAGING-238:  Return copied byte arrays in Png Chunk and Png Chunk ICCP
o IMAGING-230:  Properly close resources with try-with-resources in 
T4AndT6Compression
o IMAGING-134:  Invalid (RST) marker found in entropy data Thanks to Michael 
Sommerville.
o IMAGING-130:  Reading of some GIF images throws java.io.IOException: 
AddStringToTable: codes: 4096 code_size: 12 Thanks to Michael Sommerville.
o IMAGING-224:  Fix build errors in Travis
o IMAGING-167:  Possible infinite loop at XpmImageParser::writeImage Thanks to 
Michael Groß.
o IMAGING-211:  Imaging.getBufferedImage fails throwing 
java.lang.ArrayIndexOutOfBoundsException for specific inputs
o IMAGING-210:  Imaging.getBufferedImage fails throwing 
NegativeArraySizeException for specific inputs

Changes:
o IMAGING-258:  Prevent exception in TIFF when reading EXIF directory Thanks to 
Gary Lucas.
o IMAGING-260:  Fix mvn site failure with JavaNCSS parse error
o IMAGING-259:  Enhance TIFF DataReaders speed for compressed RGB Thanks to 
Gary Lucas.
o IMAGING-251:  Support for TIFF floating-point formats Thanks to Gary Lucas.
o IMAGING-254:  Small code improvements
o IMAGING-253:  ByteSourceInputStream has initialized its length when reading 
starts Thanks to David Hrbacek.
o IMAGING-249:  Make IPTCBlock members private and add getter/setter
o   Update tests from commons-io:commons-io 2.6 to 2.7. Thanks to 
Gary Gregory.
o   Update commons-parent from 50 to 51 #88. Thanks to Dependabot.
o   Update actions/checkout from v1 to v2.3.1 #87. Thanks to 
Dependabot.
o   Update junit-jupiter from 5.5.2 to 5.6.2 #86. Thanks to 
Dependabot.


Have fun!
-Apache Commons Imaging team

-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [commons-text] Help debugging a very strange error

2020-01-18 Thread Bruno P. Kinoshita
 I had a quick look at the code, and couldn't find anything that looked 
suspicious Christopher. There is some state, but it is private, created in the 
class static constructors, and not changed anywhere that I could find.
Interested to learn what's causing this issue in your environment. Keep us 
posted.
Cheers
Bruno


On Friday, 17 January 2020, 7:40:44 am NZDT, Christopher Schultz 
 wrote:  
 
 -BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

All,

In the past week, I've received reports of our servers starting to
incorrectly escape XML strings with consumer errors like this:

org.xml.sax.SAXParseException: The entity "rsquo" was referenced, but
not declared.

When looking at the raw text being generated, it's clear that, indeed,
the text is being escaped as if it were HTML (where the  entity
is defined) instead of XML.

The code path is a little convoluted, and I'm going to try to get the
smallest reproducible test case I can, but I thought I'd reach-out
early to see if anyone has any "aha" guidance to me before I tear-out
a whole lot of hair following this down the rabbit hole.

This is commons-text-1.1. I've looked at the release notes between 1.1
and 1.8 and I don't see anything immediately that looks like a bugfix.

The data is coming from a database, and the string is clearly correct,
and it includes a "typographic right apostrophe", which is accurately
 in HTML.

The output is being generated by Apache Velocity, through a macro
which escapes XML for us. The code in the template looks like this:

#xmlEscape($foo)

Where $foo is a string value containing this character: ’

The xmlEscape macro is defined in our global macros file which gets
evaluated on startup:

#macro (xmlEscape
$text)#if($text)$!modernEscape.escapeXml10($text.toString())#end#end

$modernEscape is an instance of
org.apache.commons.text.StringEscapeUtils in the global-scope; it's
like "application" scope for webapps, but it's in Velocity.

When we first start our web application, all seems well. After some
time, this process breaks and we start emitting "" instead of "’"
.

I can find no evidence of any of the following:

1. multiple versions of commons-text library
2. multiple versions org.apache.commons.text.StringEscapeUtil in any
library
3. any component replacing the value of $modernEscape
4. any component replacing the definition of the #xmlEscape macro

When the first report came in, we tried replicating the reporter's
experience and we could see it on one server node but not others. We
restarted that web application on that node and it started working
properly again.

Does StringEscapeUtils.escape* keep any state associated with what
it's doing? We aren't doing anything weird: just calling
StringEscapeUtils.escapeXml10 ... a lot of times, probably from many
threads.

Any ideas?

- -chris
-BEGIN PGP SIGNATURE-
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl4grhwACgkQHPApP6U8
pFga3RAAgPalqagLkEyGuWhKOaa6VbGaXRqLGNjd63byTM/TFKJyuVHsU3W0MpkC
LxG7IK1a+FuTcQuaxSY8tP9T/TH7p88y9cVpj2r8b4PXJLZ4SddOMxr/gT9MfBxA
7Vq+vpvwdkWOfcIqFBwgcx7h+EVGoUbzzYBbc301m5TxkK7kYtV6KmlGi4o3R68A
x5Ic6QtASxjaDZK6bywsHTxQWmp66+8j1QFInEtjP69Am+fkjKxE/vnTHFYha+Cr
rYuseQxhDMOyUOxhPQiU65sFzjGnS/0529EV0VykP59YNrpTGAxha7T5tSQL8iNy
p9fRv0X/Ijz6WznNiN6K36Ftu6OEyTouak0zfzKiOPZKhIvp+ofNaRbuA01O/Km/
hqt0bEdBtq8/nnYGsKmXuNv+18pWl8eY539w3kw572Rnzyxo5bdUX5YFCyq3dIeP
rhQDhA4DDpFfaHHsL1cIdLXs5b+0au85REwHusZe7iPCxZytUNahE9uDIcQhyRwJ
ix6+LgF+4nWHVtMnQL3Dw60Of/uIbvEs/Bfvc86dIGrEBhXoh2q1qLu1iwlBf7Jw
rxFsWmDv8T1jrWYmvKNispr2KUAhGf6bl+1PxxxdnKnUJdE09CqjDL/BnYclDqJZ
6f7pORqISRLiUN99KHNliC9TMwEBjmXUhV3QOoSx+d5IUTBB0/g=
=zk4m
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org

  

Re: [imaging] Thank you!

2020-01-02 Thread Bruno P. Kinoshita
 Thank you Bryan! Really happy to hear it was helpful to you and your wife.
Feedback, both like this or bug/improvement/feature requests, is really 
important for the project.
All the best for you too. And feel free to drop an e-mail here or raise issues 
on JIRA if you have any suggestion. 1.0-alpha2 should come out in the first 
quarter of this year.

Bruno

On Friday, 3 January 2020, 7:01:13 am NZDT, Bryan Atsatt 
 wrote:  
 
 Just wanted to let the developers know that this project saved the day for
an important Christmas present for my wife.

She has wanted access to about 30k photos I have in an old Photoshop
Elements catalog (with lots of keywords etc added), but didn't want to use
that app.

This library enabled me to preserve all the data by updating the photos,
adding (approximate) GPS info where missing and making them searchable in
Google Photos by appending keywords to the captions.

She now has all of them in her Google Photos and on a portable drive, with
no PSE required, and is very happy.

So... thanks for all the hard work everyone, and Happy New Decade to you
all.

// Bryan
  

Re: [Text][Lang] support for stringutils like methods with surrogate char strings?

2019-11-22 Thread Bruno P. Kinoshita
 Hi Marshall,
Not aware of variants supporting surrogate char strings.

Some methods and classes that were more text-oriented from [lang] were moved to 
[text]. And some new code in [text] already supports surrogate characters 
(there's some support in CharSequenceTranslator, JavaUnicodeEscaper, 
UnicodeUnpairedSurrogateRemover, StringEscapeUtils).
I remember seeing some discussion around supporting CharSequences and surrogate 
pairs in tickets & PR's for [text]. Supporting it is not easy, especially when 
you already have an API in place.
But providing alternative methods, or adding support to surrogate char strings 
in the existing methods would be a good improvement for the current API if 
possible.
If you have use cases for some of the existing methods, feel free to create a 
JIRA issue for either [text] and/or [lang], explaining your requirements. Then 
eventually we may get some contributor volunteering to work on it.
CheersBruno



On Saturday, 23 November 2019, 10:59:36 am NZDT, Marshall Schor 
 wrote:  
 
 In looking at the code, it seems these are designed for strings not having
surrogate characters.

Is there a variant somewhere for these methods which work with strings having
surrogate characters?

If not, are there plans for this kind of thing in the near future?

- Marshall Schor


-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org

  

Re: [CONFIGURATION2] Handling of multiline values in INI files ?

2019-11-15 Thread Bruno P. Kinoshita
 Hi Thomas,
I am not aware of a parser that supports this format i [configuration]. Looking 
at JIRA, the closest I found was CONFIGURATION-324, which appears to work with 
the code from master (didn't have time to check out the latest release).
But the CONFIGURATION-324 requires a \ at the end of the value. I tested your 
file, and if you add a space + \ at the end of the configuration files, then it 
works.

https://gist.github.com/kinow/4f20183e579f5b33535446146daf2e69
I think if nobody else replies here, if you could create an issue in JIRA 
that'd be great, as eventually someone would volunteer to add that either to an 
existing parser, or to a new one.
I tested Python 3's configparser std lib module, and it parses your file 
successfully with no changes (`config['core']['links']` returns the data as-is, 
with the line-breaks etc).

CheersBruno

On Friday, 15 November 2019, 10:47:23 am NZDT, Thomas Francart 
 wrote:  
 
 Hello

>From my test it looks like multiline values in INI files are not supported
by commons-configuration2. I need to parse files like this one :
https://github.com/glottolog/glottolog/blob/master/languoids/tree/abin1243/md.ini,
and if I access configuration entry like "glottolog" on line 19 I am
getting an empty string since the values are on the following lines.

ConfigParser in Python does support multiline values :
https://docs.python.org/3/library/configparser.html

Is there an option I missed in the INIConfiguration to handle multiline
values ? or is completely out of hope ?

Thanks
Thomas

-- 

*Thomas Francart* -* SPARNA*
Web de *données* | Architecture de l'*information* | Accès aux
*connaissances*
blog : blog.sparna.fr, site : sparna.fr, linkedin :
fr.linkedin.com/in/thomasfrancart
tel :  +33 (0)6.71.11.25.97, skype : francartthomas  

Re: [lang3]

2019-04-15 Thread Bruno P. Kinoshita
 Great! 

Rob, just in case I ever do the same. Could you share what steps you had to do 
in order to upload the javadocs, please?
Thanks for the super quick fix!
Bruno

On Tuesday, 16 April 2019, 10:56:22 am NZST, Rob Tompkins 
 wrote:  
 
 

> On Apr 15, 2019, at 3:08 PM, Gary Gregory  wrote:
> 
> On Mon, Apr 15, 2019 at 6:06 PM Bruno P. Kinoshita
>  <mailto:brunodepau...@yahoo.com.br.invalid>> wrote:
> 
>> I think that should be fine. I think something similar already happened
>> in the past, but can't recall which component.
>> 
>>    On Tuesday, 16 April 2019, 9:58:43 am NZST, Rob Tompkins <
>> chtom...@gmail.com> wrote:
>> 
>> 
>> 
>>> On Apr 15, 2019, at 2:49 PM, Bruno P. Kinoshita <
>> brunodepau...@yahoo.com.br.invalid> wrote:
>>> 
>>> 
>>> Hi Scott,
>>> I believe it was a mistake. Had a look at 3.8 and we had published it
>> before.
>>> Just had a look at the vote thread, and it appears the javadocs jar was
>> not included in the process. Possibly something with our pom.xml and
>> plugins set up.
>>> 
>>> @Rob, @Gary, is it possible to upload just the jar to an existing
>> release?
>> 
>> Yes. My plan was to do just that. With a [LAZY][VOTE] on the staged
>> artifacts in nexus. Thoughts?
>> 
> 
> Since we approved the sources tagged and we are not changing those, I'd say
> we are OK to push out the javadoc files.

This should be fixed now. It may take a little while for maven central to pick 
up the changes. @Scott - many thanks for the catch there!

Cheers,
-Rob

> 
> Gary
> 
> 
>> 
>> -Rob
>> 
>>> CheersBruno
>>> 
>>>  On Tuesday, 16 April 2019, 9:44:07 am NZST, Scott Palmer <
>> swpal...@gmail.com> wrote:
>>> 
>>> I noticed there are no javadocs on Maven Central for commons-lang3 3.9.
>>> Is that intentional or a mistake?
>>> 
>>> Scott
>>> (please copy me on responses as I am not subscribed to the list)
>>> 
>>> -
>>> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
>>> For additional commands, e-mail: user-h...@commons.apache.org
>>> 
>> 
>> -
>> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
>> For additional commands, e-mail: user-h...@commons.apache.org
  

Re: [lang3]

2019-04-15 Thread Bruno P. Kinoshita
 I think that should be fine. I think something similar already happened in the 
past, but can't recall which component.

On Tuesday, 16 April 2019, 9:58:43 am NZST, Rob Tompkins 
 wrote:  
 
 

> On Apr 15, 2019, at 2:49 PM, Bruno P. Kinoshita 
>  wrote:
> 
> 
> Hi Scott,
> I believe it was a mistake. Had a look at 3.8 and we had published it before.
> Just had a look at the vote thread, and it appears the javadocs jar was not 
> included in the process. Possibly something with our pom.xml and plugins set 
> up.
> 
> @Rob, @Gary, is it possible to upload just the jar to an existing release?

Yes. My plan was to do just that. With a [LAZY][VOTE] on the staged artifacts 
in nexus. Thoughts?

-Rob

> CheersBruno
> 
>    On Tuesday, 16 April 2019, 9:44:07 am NZST, Scott Palmer 
> wrote:  
> 
> I noticed there are no javadocs on Maven Central for commons-lang3 3.9.
> Is that intentional or a mistake?
> 
> Scott
> (please copy me on responses as I am not subscribed to the list)
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> For additional commands, e-mail: user-h...@commons.apache.org
> 

-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org
  

Re: [lang3]

2019-04-15 Thread Bruno P. Kinoshita
 
Hi Scott,
I believe it was a mistake. Had a look at 3.8 and we had published it before.
Just had a look at the vote thread, and it appears the javadocs jar was not 
included in the process. Possibly something with our pom.xml and plugins set up.

@Rob, @Gary, is it possible to upload just the jar to an existing release?
CheersBruno

On Tuesday, 16 April 2019, 9:44:07 am NZST, Scott Palmer 
 wrote:  
 
 I noticed there are no javadocs on Maven Central for commons-lang3 3.9.
Is that intentional or a mistake?

Scott
(please copy me on responses as I am not subscribed to the list)

-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org

  

Re: commons-imaging stability?

2019-01-25 Thread Bruno P. Kinoshita
 Hi Matt,
The project was called Sanselan during its incubation in ASF. It had a few full 
releases, without reaching a 1.0 (0.97 was the last release line I believe).
Then when it was moved under commons, got renamed to Apache Commons Imaging. 
Several packages changes, and the code base has changed significantly since 
Sanselan too.
Alas, there was a long hiatus since Sanselan's last release. Commons Imaging 
1.0 vote came out some months ago, but due to some issues with that release, it 
was postponed. I am now looking for some spare time to prepare the 1.0 release 
again.
If you intend to use Commons Imaging, it might be a good idea to wait for the 
1.0 release. Can't promise when I will have time to work on the release again, 
but my plan is to have it released in February (or earlier). Otherwise my next 
long window for OSS development would be April.
Other committers may step in and work on it before as well. If you have time to 
help with the release, especially testing, that would be great too.
CheersBruno

On Saturday, 26 January 2019, 11:03:32 AM NZDT, Matt Seil 
 wrote:  
 
 Greetings!

I'm the project Co-Lead for OWASP's ESAPI project, and I'm looking
into this library to enhance capability.  What I'm unsure about is
that it looks like every release was either "incubator" or "Snapshot,"
and if we brought it on as a dependency, many companies have rules
against using "snapshot" terminology.

What kind of instability are we talking about?  Is it security related
or just bugs for particular file types?

This is what sparked my interest:
https://www.owasp.org/index.php/Protect_FileUpload_Against_Malicious_File#Case_n.C2.B03:_Images

-- 
xeno6696

-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org

  

Re: [imaging] Is it possible to release the current version as a release candidate from ASF

2018-09-06 Thread Bruno P. Kinoshita
Hi Phil,

I just need to find some time to upgrade a few plugins/dependencies, learn 
about the release-plugin, and leave everything ready for the 1.0-alpha release, 
but all issues for this version were fixed already [1][2]



Hopefully soon we might have a 1.0-alpha in Maven Central.

Cheers
Bruno



[1] https://markmail.org/message/txsxrr7mlx2cw5rg

[2] https://markmail.org/thread/uq2pm24lx2hc5eux





From: P. Ottlinger 
To: user@commons.apache.org 
Sent: Friday, 7 September 2018 7:14 AM
Subject: [imaging] Is it possible to release the current version as a release 
candidate from ASF



Hi,


while going away from Sanselan

https://mvnrepository.com/artifact/org.apache.sanselan/sanselan/0.97-incubator

to

https://mvnrepository.com/artifact/org.apache.commons/commons-imaging

I'm unable to find an official release version.


This hinders adoption in Travis as SNAPSHOT references happen not to

work all the time.


Is it possible to do a release of the current version - if it's not a

1.0.0 I'd be glad with a 0.9.8 from apache/in maven central.


What do you think?


Thanks,

Phil


-

To unsubscribe, e-mail: user-unsubscr...@commons.apache.org

For additional commands, e-mail: user-h...@commons.apache.org

-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [imaging] Comment tag problem

2018-07-06 Thread Bruno P. Kinoshita
 > Feel free to chime in there and watch that ticket if you would like to see 
> > that feature

> > implemented, or give any suggestions.

> >

> >

> > Hope that helps,

>

>

> It does, thanks a lot.

>

> All the best,

> Andrea

>

> >

> > Bruno

> >

> > 

> > From: andrea antonello 

> > To: Commons Users List 

> > Sent: Monday, 30 April 2018 7:55 PM

> > Subject: Re: [imaging] Comment tag problem

> >

> >

> >

> > Hi Bruno and Martin,

> > thanks a ton for your help.

> >

> > I tried the code but nothing changes.

> >

> > My output doesn't have a COM segment, but I noticed something.

> >

> > This is the info dump of the image before applying Martin's code:

> >

> > File Type = JPEG

> > File Size = 231038

> > @0=0   :  

> > @0x002=2   : 0xffe0 length 16, 'JFIF'

> > @0x00b=11  :  Version   = 1.2

> > @0x00d=13  :  Units = 'aspect ratio'

> > @0x00e=14  :  Xdensity  = 1

> > @0x010=16  :  Ydensity  = 1

> > @0x012=18  :  XThumbnail= 0

> > @0x013=19  :  YThumbnail= 0

> > @0x013=19  :

> > @0x014=20  : length 67

> > @0x059=89  : length 67

> > @0x09e=158 : length 17, 8 bits/sample,

> > components=3, width=1418, height=969

> > @0x0b1=177 : length 31 table class = 0 table id = 0

> > @0x0d2=210 : length 181 table class = 0 table id = 1

> > @0x189=393 : length 31 table class = 1 table id = 0

> > @0x1aa=426 : length 181 table class = 1 table id = 1

> > @0x261=609 : length 12  start of JPEG data, 3

> > components 1374042 pixels

> > @0x003867c=231036  :   JPEG length 231038

> > -0x003867d=231037  :  END OF FILE

> > @0=0   :  Start of JPEG baseline DCT compressed primary

> > image [1418x969] length 231038 (APP0)

> > -0x003867d=231037  :End of JPEG primary image data

> > Number of images = 1

> > File Format = JPEG/APP0/JFIF

> >

> >

> > and this is when I do apply it:

> >

> > File Type = JPEG

> > File Size = 231183

> > @0=0   :  

> > @0x002=2   : 0xffe0 length 16, 'JFIF'

> > @0x00b=11  :  Version   = 1.2

> > @0x00d=13  :  Units = 'aspect ratio'

> > @0x00e=14  :  Xdensity  = 1

> > @0x010=16  :  Ydensity  = 1

> > @0x012=18  :  XThumbnail= 0

> > @0x013=19  :  YThumbnail= 0

> > @0x013=19  :

> > @0x014=20  : 0xffe1 length 143,

> > 'http://ns.adobe.com/xap/1.0/' - unknown format - (not dumped: use -A)

> > -0x0a4=164 :

> > @0x0a5=165 : length 67

> > @0x0ea=234 : length 67

> > @0x12f=303 : length 17, 8 bits/sample,

> > components=3, width=1418, height=969

> > @0x142=322 : length 31 table class = 0 table id = 0

> > @0x163=355 : length 181 table class = 0 table id = 1

> > @0x21a=538 : length 31 table class = 1 table id = 0

> > @0x23b=571 : length 181 table class = 1 table id = 1

> > @0x2f2=754 : length 12  start of JPEG data, 3

> > components 1374042 pixels

> > @0x003870d=231181  :   JPEG length 231183

> > -0x003870e=231182  :  END OF FILE

> > @0=0   :  Start of JPEG baseline DCT compressed primary

> > image [1418x969] length 231183

> > -0x003870e=231182  :End of JPEG primary image data

> > Number of images = 1

> > File Format = JPEG/APP0/JFIF/APP1

> >

> > It looks like what I did got into the tag: JPEG_APP1, while not

> > JPEG_COM has been created as in:

> >

> > File Type = JPEG

> > File Size = 438694

> > @0=0   :  

> > @0x002=2   : length 137:

> > ''GEO-Information,46.5640616313:11.523790723,46.5640616313:11.5093674258,46.5585048222:11.523790723,46.5585048222:11.5093674258,0.00\0''

> > @0x08d=141 : 0xffe0 length 16, 'JFIF'

> > @0x096=150 :  Version   = 1.1

> > [...]

> >

> >

> > Did I miss something or can something be changed to get there?

> >

> > I tried to have a look at the mentioned testcase but have not been

> > able to understand how to switch segment or how segments are chosen in

> > f

Re: [imaging] Comment tag problem

2018-04-30 Thread Bruno P. Kinoshita
D OF FILE
@0=0   :  Start of JPEG baseline DCT compressed primary
image [1418x969] length 231183
-0x003870e=231182  :End of JPEG primary image data
Number of images = 1
File Format = JPEG/APP0/JFIF/APP1

It looks like what I did got into the tag: JPEG_APP1, while not
JPEG_COM has been created as in:

File Type = JPEG
File Size = 438694
@0=0   :  
@0x002=2   : length 137:
''GEO-Information,46.5640616313:11.523790723,46.5640616313:11.5093674258,46.5585048222:11.523790723,46.5585048222:11.5093674258,0.00\0''
@0x08d=141 : 0xffe0 length 16, 'JFIF'
@0x096=150 :  Version   = 1.1
[...]


Did I miss something or can something be changed to get there?

I tried to have a look at the mentioned testcase but have not been
able to understand how to switch segment or how segments are chosen in
first place.

Any idea?
Thank you,
Andrea







On Sat, Apr 28, 2018 at 3:15 AM, Bruno P. Kinoshita
<brunodepau...@yahoo.com.br.invalid> wrote:
> Hi Martin,
>
>
>>if your requirement is to insert a comment regardless of Java being installed 
>>why not insert a XMP comment into JPEG or GIF using exiv2 tool
>
>
> It's actually Andrea who is working with comments & JPEG images. I was just 
> trying to help him, assuming he wants/needs to do that in Java. He pointed 
> that he could do that with exiftool too (see previous e-mails in the thread 
> for more).
>
> @Andrea, see Martin's code in the e-mail below.
> Thanks Martin!
> Bruno
>
>
>
> ________
> From: Martin Gainty <mgai...@hotmail.com>
> To: Commons Users List <user@commons.apache.org>; Bruno P. Kinoshita 
> <brunodepau...@yahoo.com.br>
> Sent: Saturday, 28 April 2018 5:38 AM
> Subject: Re: [imaging] Comment tag problem
>
>
>
> Bruno
>
> if your requirement is to insert a comment regardless of Java being installed 
> why not insert a XMP comment into JPEG or GIF using exiv2 tool
>
> http://www.exiv2.org/manpage.html
>
> Exiv2 utility manual - Image metadata library and 
> tools<http://www.exiv2.org/manpage.html>
> www.exiv2.org
> Open Source Exif, IPTC and XMP metadata library and tools with Exif MakerNote 
> and read/write support
>
>
> MG>see below
>
> 
> From: Bruno P. Kinoshita <brunodepau...@yahoo.com.br.INVALID>
> Sent: Friday, April 27, 2018 8:39 AM
> To: Commons Users List
> Subject: Re: [imaging] Comment tag problem
>
> Hi Andrea!
>
> Today spent some minutes with Eclipse and the code base, plus exiftool, to 
> see where that comment was coming from.
>
> That COM, or Comment, that you see in exiftool output is not exactly a 
> metadata tag. It is actually a JPEG Segment. Sorry for the other suggestions.
>
> As far as I know, we are not able to change the segments, but only the 
> metadata within the TIFF/EXIF directories & tags [2].
>
> You can still use comments if that's OK, but not sure how you would achieve 
> adding the Comment in Java.
> MG>testXMPInsert borrowed from JpegXmpRewriteTest.java
> {
> // test insert
> String newXmpXml = "comment";
> //subin your fileName to imageFile.getName()
> File updated = createTempFile(imageFile.getName() + ".", ".jpg");
> OutputStream os = null;
> try
> {
> os = new FileOutputStream(updated);
> os = new BufferedOutputStream(os);
> new org.apache.sanselan.formats.jpeg..xmp.JpegXmpRewriter().updateXmpXml(
>   
> org.apache.sanselan.common.byteSources.ByteSourceFile(noXmpFile), os,
> newXmpXml);
> } finally
> {
> os.close();
> os = null;
> }
>
> // Debug.debug("Source Segments:");
> // new JpegUtils().dumpJFIF(new ByteSourceFile(updated));
>
> String outXmp = new 
> org.apache.sanselan.formats.jpeg.JpegImageParser().getXmpXml(
> new ByteSourceFile(updated), params);
> assertNotNull(outXmp);
> assertEquals(outXmp, newXmpXml);
> }
>
> MG>please confirm this works for you
> MG>required sanselanependency for pom.xml:
> org.apache.sanselan
>   sanselan
>   0.97-incubator
>
>
> Bruno
> MG>?
> MG>Martin-
>
>
> [1] http://u88.n24.queensu.ca/exiftool/forum/index.php?topic=3893.0
> Writing 
> comments<http://u88.n24.queensu.ca/exiftool/forum/index.php?topic=3893.0>
> u88.n24.queensu.ca
> Writing comments
>
>
>
> [2] https://issues.apache.org/jira/browse/IMAGING-55
>
>
> 
> From: andrea antonello <andrea.antone...@gmail.com>
> To: Commons Users List <user@commons.apache.org>
> Sent: Thursday, 26 April 2018 8:02 PM
> Subject: Re: [imaging] Comment tag problem
>
>
>

Re: [imaging] Comment tag problem

2018-04-27 Thread Bruno P. Kinoshita
Hi Martin,


>if your requirement is to insert a comment regardless of Java being installed 
>why not insert a XMP comment into JPEG or GIF using exiv2 tool


It's actually Andrea who is working with comments & JPEG images. I was just 
trying to help him, assuming he wants/needs to do that in Java. He pointed that 
he could do that with exiftool too (see previous e-mails in the thread for 
more).

@Andrea, see Martin's code in the e-mail below.
Thanks Martin!
Bruno




From: Martin Gainty <mgai...@hotmail.com>
To: Commons Users List <user@commons.apache.org>; Bruno P. Kinoshita 
<brunodepau...@yahoo.com.br> 
Sent: Saturday, 28 April 2018 5:38 AM
Subject: Re: [imaging] Comment tag problem



Bruno

if your requirement is to insert a comment regardless of Java being installed 
why not insert a XMP comment into JPEG or GIF using exiv2 tool

http://www.exiv2.org/manpage.html

Exiv2 utility manual - Image metadata library and 
tools<http://www.exiv2.org/manpage.html>
www.exiv2.org
Open Source Exif, IPTC and XMP metadata library and tools with Exif MakerNote 
and read/write support


MG>see below

________
From: Bruno P. Kinoshita <brunodepau...@yahoo.com.br.INVALID>
Sent: Friday, April 27, 2018 8:39 AM
To: Commons Users List
Subject: Re: [imaging] Comment tag problem

Hi Andrea!

Today spent some minutes with Eclipse and the code base, plus exiftool, to see 
where that comment was coming from.

That COM, or Comment, that you see in exiftool output is not exactly a metadata 
tag. It is actually a JPEG Segment. Sorry for the other suggestions.

As far as I know, we are not able to change the segments, but only the metadata 
within the TIFF/EXIF directories & tags [2].

You can still use comments if that's OK, but not sure how you would achieve 
adding the Comment in Java.
MG>testXMPInsert borrowed from JpegXmpRewriteTest.java
{
// test insert
String newXmpXml = "comment";
//subin your fileName to imageFile.getName()
File updated = createTempFile(imageFile.getName() + ".", ".jpg");
OutputStream os = null;
try
{
os = new FileOutputStream(updated);
os = new BufferedOutputStream(os);
new org.apache.sanselan.formats.jpeg..xmp.JpegXmpRewriter().updateXmpXml(
  
org.apache.sanselan.common.byteSources.ByteSourceFile(noXmpFile), os,
newXmpXml);
} finally
{
os.close();
os = null;
}

// Debug.debug("Source Segments:");
// new JpegUtils().dumpJFIF(new ByteSourceFile(updated));

String outXmp = new 
org.apache.sanselan.formats.jpeg.JpegImageParser().getXmpXml(
new ByteSourceFile(updated), params);
assertNotNull(outXmp);
assertEquals(outXmp, newXmpXml);
}

MG>please confirm this works for you
MG>required sanselanependency for pom.xml:
org.apache.sanselan
  sanselan
  0.97-incubator


Bruno
MG>?
MG>Martin-


[1] http://u88.n24.queensu.ca/exiftool/forum/index.php?topic=3893.0
Writing 
comments<http://u88.n24.queensu.ca/exiftool/forum/index.php?topic=3893.0>
u88.n24.queensu.ca
Writing comments



[2] https://issues.apache.org/jira/browse/IMAGING-55



From: andrea antonello <andrea.antone...@gmail.com>
To: Commons Users List <user@commons.apache.org>
Sent: Thursday, 26 April 2018 8:02 PM
Subject: Re: [imaging] Comment tag problem



> I normally use exiftool to compare what imaging is producing. The htmldump is 
> quite useful.

I just ran the normal info extraction and here you see the comment I
would like to reproduce (Comment):

ExifTool Version Number : 10.94
File Name   : 109_Background.jpg
Directory   : .
File Size   : 428 kB
File Modification Date/Time : 2018:03:31 11:01:51+02:00
File Access Date/Time   : 2018:04:26 08:59:06+02:00
File Inode Change Date/Time : 2018:03:31 11:01:56+02:00
File Permissions: rw-rw-r--
File Type   : JPEG
File Type Extension : jpg
MIME Type   : image/jpeg
Comment :
GEO-Information,46.5640616313:11.523790723,46.5640616313:11.5093674258,46.5585048222:11.523790723,46.5585048222:11.5093674258,0.00
JFIF Version: 1.01
Resolution Unit : inches
X Resolution: 96
Y Resolution: 96
Image Width : 1608
Image Height: 901
Encoding Process: Baseline DCT, Huffman coding
Bits Per Sample : 8
Color Components: 3
Y Cb Cr Sub Sampling: YCbCr4:2:0 (2 2)
Image Size  : 1608x901
Megapixels  : 1.4


> I thought you had to create the tag in Java, but if you can use other tools 
> and it's easier for you, then that might be the best option.

Yes, I do have to recreate it in jav

Re: [imaging] Comment tag problem

2018-04-27 Thread Bruno P. Kinoshita
Hi Andrea!

Today spent some minutes with Eclipse and the code base, plus exiftool, to see 
where that comment was coming from.

That COM, or Comment, that you see in exiftool output is not exactly a metadata 
tag. It is actually a JPEG Segment. Sorry for the other suggestions.

As far as I know, we are not able to change the segments, but only the metadata 
within the TIFF/EXIF directories & tags [2].

You can still use comments if that's OK, but not sure how you would achieve 
adding the Comment in Java.

Bruno


[1] http://u88.n24.queensu.ca/exiftool/forum/index.php?topic=3893.0
[2] https://issues.apache.org/jira/browse/IMAGING-55



From: andrea antonello 
To: Commons Users List  
Sent: Thursday, 26 April 2018 8:02 PM
Subject: Re: [imaging] Comment tag problem



> I normally use exiftool to compare what imaging is producing. The htmldump is 
> quite useful.

I just ran the normal info extraction and here you see the comment I
would like to reproduce (Comment):

ExifTool Version Number : 10.94
File Name   : 109_Background.jpg
Directory   : .
File Size   : 428 kB
File Modification Date/Time : 2018:03:31 11:01:51+02:00
File Access Date/Time   : 2018:04:26 08:59:06+02:00
File Inode Change Date/Time : 2018:03:31 11:01:56+02:00
File Permissions: rw-rw-r--
File Type   : JPEG
File Type Extension : jpg
MIME Type   : image/jpeg
Comment :
GEO-Information,46.5640616313:11.523790723,46.5640616313:11.5093674258,46.5585048222:11.523790723,46.5585048222:11.5093674258,0.00
JFIF Version: 1.01
Resolution Unit : inches
X Resolution: 96
Y Resolution: 96
Image Width : 1608
Image Height: 901
Encoding Process: Baseline DCT, Huffman coding
Bits Per Sample : 8
Color Components: 3
Y Cb Cr Sub Sampling: YCbCr4:2:0 (2 2)
Image Size  : 1608x901
Megapixels  : 1.4


> I thought you had to create the tag in Java, but if you can use other tools 
> and it's easier for you, then that might be the best option.

Yes, I do have to recreate it in java. I was just trying to use other
tools to check what the comment tag is.
Do you have an idea on how to create the above Comment tag?

> Otherwise you can create pretty much any other metadata tag you'd like with 
> some Java coding.

That is what I would love to end up with.
Thanks a ton,
Andrea


> 
> From: andrea antonello 
> To: Commons Users List 
> Sent: Thursday, 26 April 2018 7:15 PM
> Subject: Re: [imaging] Comment tag problem
>
>
>
> Hi Bruno,
>
>> The EXIF tags in imaging should match what's in this page:
>> https://sno.phy.queensu.ca/~phil/exiftool/TagNames/EXIF.html
>>
>> Which contains the XPComment and UserComment tags you mentioned, but no 
>> equivalent to the other comment one.
>
> this is quite inetersting. Actually I have been told that the command:
>
> exiftool -comment='mycomment'
>
> creates exaclty the comment I am not able to reproduce. Do you know
> what that is?
>
>
>> If you really need to match that tag, then I think you should be able to 
>> create your own custom metadata entry.
>>
>> I think [1] the ExifRewriter and its test class have some code that shows 
>> how to rewrite metadata. Find the directory (TiffOutputDirectory.java) with 
>> the metadata fields, perhaps remove the UserComment/XPComment if necessary, 
>> and then add a new field (TiffOutputField.java), with your metadata tag 
>> (TagInfo.java)
>
> I will try again. I tried already that path, but since it asks me for
> a tag (integer) I then end up to have it named as the tag I am trying
> to substitute...
>
> Thanks,
> Andrea
>
>
>>
>>
>> Hope that helps,
>> Bruno
>>
>>
>> [1]
>> https://github.com/apache/commons-imaging/blob/master/src/main/java/org/apache/commons/imaging/formats/jpeg/exif/ExifRewriter.java
>>
>> 
>> From: andrea antonello 
>> To: Commons Users List 
>> Sent: Thursday, 26 April 2018 1:46 AM
>> Subject: Re: [imaging] Comment tag problem
>>
>>
>>
>> Hi Bruno,
>> thanks for your reply.
>>
>>> I think you tried to include screenshots? If so, it doesn't work very well 
>>> in this mailing list.
>>
>>
>> ohh, I didn't figure and didn't notice.
>>
>>>
>>> Could you try adding as attachment, or upload them, or use plain text to 
>>> describe the issue? I recently had to work on the tags for some TIFF & JPEG 
>>> metadata in [imaging], so hopefully we will be able to locate the right tag.
>>
>>
>> Fantastic. I investigated further but am still not able 

Re: [imaging] Comment tag problem

2018-04-26 Thread Bruno P. Kinoshita
I normally use exiftool to compare what imaging is producing. The htmldump is 
quite useful. I thought you had to create the tag in Java, but if you can use 
other tools and it's easier for you, then that might be the best option.


Otherwise you can create pretty much any other metadata tag you'd like with 
some Java coding.

From: andrea antonello 
To: Commons Users List  
Sent: Thursday, 26 April 2018 7:15 PM
Subject: Re: [imaging] Comment tag problem



Hi Bruno,

> The EXIF tags in imaging should match what's in this page:
> https://sno.phy.queensu.ca/~phil/exiftool/TagNames/EXIF.html
>
> Which contains the XPComment and UserComment tags you mentioned, but no 
> equivalent to the other comment one.

this is quite inetersting. Actually I have been told that the command:

exiftool -comment='mycomment'

creates exaclty the comment I am not able to reproduce. Do you know
what that is?


> If you really need to match that tag, then I think you should be able to 
> create your own custom metadata entry.
>
> I think [1] the ExifRewriter and its test class have some code that shows how 
> to rewrite metadata. Find the directory (TiffOutputDirectory.java) with the 
> metadata fields, perhaps remove the UserComment/XPComment if necessary, and 
> then add a new field (TiffOutputField.java), with your metadata tag 
> (TagInfo.java)

I will try again. I tried already that path, but since it asks me for
a tag (integer) I then end up to have it named as the tag I am trying
to substitute...

Thanks,
Andrea


>
>
> Hope that helps,
> Bruno
>
>
> [1]
> https://github.com/apache/commons-imaging/blob/master/src/main/java/org/apache/commons/imaging/formats/jpeg/exif/ExifRewriter.java
>
> 
> From: andrea antonello 
> To: Commons Users List 
> Sent: Thursday, 26 April 2018 1:46 AM
> Subject: Re: [imaging] Comment tag problem
>
>
>
> Hi Bruno,
> thanks for your reply.
>
>> I think you tried to include screenshots? If so, it doesn't work very well 
>> in this mailing list.
>
>
> ohh, I didn't figure and didn't notice.
>
>>
>> Could you try adding as attachment, or upload them, or use plain text to 
>> describe the issue? I recently had to work on the tags for some TIFF & JPEG 
>> metadata in [imaging], so hopefully we will be able to locate the right tag.
>
>
> Fantastic. I investigated further but am still not able to solve this.
>
> The tag I would like to update is one that produces (at least this is
> what I read in the imagemagick image info) a section
>
> Properties:
>
> and under start section I find
>
> comment: 
> GEO-Information,46.5640616313:11.523790723,46.5640616313:11.5093674258,46.5585048222:11.523790723,46.5585048222:11.5093674258,0.00
>
> The most similar result I have been able to produce with the tags is:
>
> exif:UserComment:GEO-Information,46.5640616313:11.523790723,46.5640616313:11.5093674258,46.5585048222:11.523790723,46.5585048222:11.5093674258,0.00
>
> and
>
> exif:WinXP-Comments:GEO-Information,46.5640616313:11.523790723,46.5640616313:11.5093674258,46.5585048222:11.523790723,46.5585048222:11.5093674258,0.00
>
> both not the same as what i am looking for.
>
>
> I have been able to print the following information through an
> application called exifprobe:
>
> @0x002=2   : length 137:
> ''GEO-Information,46.5640616313:11.523790723,46.5640616313:11.5093674258,46.5585048222:11.523790723,46.5585048222:11.5093674258,0.00\0''
> @0x08d=141 : 0xffe0 length 16, 'JFIF'
> @0x096=150 :  Version   = 1.1
> @0x098=152 :  Units = 'dots/inch'
> @0x099=153 :  Xdensity  = 96
> @0x09b=155 :  Ydensity  = 96
> @0x09d=157 :  XThumbnail= 0
> @0x09e=158 :  YThumbnail= 0
> @0x09e=158 :
> @0x09f=159 : length 67
> @0x0e4=228 : length 67
> @0x129=297 : length 17, 8 bits/sample,
> components=3, width=1608, height=901
> @0x13c=316 : length 31 table class = 0 table id = 0
> @0x15d=349 : length 181 table class = 0 table id = 1
> @0x214=532 : length 31 table class = 1 table id = 0
> @0x235=565 : length 181 table class = 1 table id = 1
> @0x2ec=748 : length 12  start of JPEG data, 3
> components 1448808 pixels
> @0x006b1a4=438692  :   JPEG length 438694
>
> So I think this (JPEG_COM) is not an exif tag as I had been told. I am
> guessing this is reflected by the library's ComSegment class, but I
> could not find any documentation or testcase which would tell me what
> it is and how to rewrite/update it.
>
> Any help is most appreciated,
> Thanks,
>
> Andrea
>
>
>
>
>>
>> CheersBruno
>>
>>
>>   From: andrea antonello 
>>  To: Commons Users List 
>>  Sent: Wednesday, 25 

Re: [imaging] Comment tag problem

2018-04-26 Thread Bruno P. Kinoshita
Hi Andrea,

The EXIF tags in imaging should match what's in this page: 
https://sno.phy.queensu.ca/~phil/exiftool/TagNames/EXIF.html

Which contains the XPComment and UserComment tags you mentioned, but no 
equivalent to the other comment one.


If you really need to match that tag, then I think you should be able to create 
your own custom metadata entry.

I think [1] the ExifRewriter and its test class have some code that shows how 
to rewrite metadata. Find the directory (TiffOutputDirectory.java) with the 
metadata fields, perhaps remove the UserComment/XPComment if necessary, and 
then add a new field (TiffOutputField.java), with your metadata tag 
(TagInfo.java)


Hope that helps,
Bruno


[1] 
https://github.com/apache/commons-imaging/blob/master/src/main/java/org/apache/commons/imaging/formats/jpeg/exif/ExifRewriter.java


From: andrea antonello 
To: Commons Users List  
Sent: Thursday, 26 April 2018 1:46 AM
Subject: Re: [imaging] Comment tag problem



Hi Bruno,
thanks for your reply.

> I think you tried to include screenshots? If so, it doesn't work very well in 
> this mailing list.


ohh, I didn't figure and didn't notice.

>
> Could you try adding as attachment, or upload them, or use plain text to 
> describe the issue? I recently had to work on the tags for some TIFF & JPEG 
> metadata in [imaging], so hopefully we will be able to locate the right tag.


Fantastic. I investigated further but am still not able to solve this.

The tag I would like to update is one that produces (at least this is
what I read in the imagemagick image info) a section

Properties:

and under start section I find

comment: 
GEO-Information,46.5640616313:11.523790723,46.5640616313:11.5093674258,46.5585048222:11.523790723,46.5585048222:11.5093674258,0.00

The most similar result I have been able to produce with the tags is:

exif:UserComment:GEO-Information,46.5640616313:11.523790723,46.5640616313:11.5093674258,46.5585048222:11.523790723,46.5585048222:11.5093674258,0.00

and

exif:WinXP-Comments:GEO-Information,46.5640616313:11.523790723,46.5640616313:11.5093674258,46.5585048222:11.523790723,46.5585048222:11.5093674258,0.00

both not the same as what i am looking for.


I have been able to print the following information through an
application called exifprobe:

@0x002=2   : length 137:
''GEO-Information,46.5640616313:11.523790723,46.5640616313:11.5093674258,46.5585048222:11.523790723,46.5585048222:11.5093674258,0.00\0''
@0x08d=141 : 0xffe0 length 16, 'JFIF'
@0x096=150 :  Version   = 1.1
@0x098=152 :  Units = 'dots/inch'
@0x099=153 :  Xdensity  = 96
@0x09b=155 :  Ydensity  = 96
@0x09d=157 :  XThumbnail= 0
@0x09e=158 :  YThumbnail= 0
@0x09e=158 :
@0x09f=159 : length 67
@0x0e4=228 : length 67
@0x129=297 : length 17, 8 bits/sample,
components=3, width=1608, height=901
@0x13c=316 : length 31 table class = 0 table id = 0
@0x15d=349 : length 181 table class = 0 table id = 1
@0x214=532 : length 31 table class = 1 table id = 0
@0x235=565 : length 181 table class = 1 table id = 1
@0x2ec=748 : length 12  start of JPEG data, 3
components 1448808 pixels
@0x006b1a4=438692  :   JPEG length 438694

So I think this (JPEG_COM) is not an exif tag as I had been told. I am
guessing this is reflected by the library's ComSegment class, but I
could not find any documentation or testcase which would tell me what
it is and how to rewrite/update it.

Any help is most appreciated,
Thanks,

Andrea




>
> CheersBruno
>
>
>   From: andrea antonello 
>  To: Commons Users List 
>  Sent: Wednesday, 25 April 2018 1:56 AM
>  Subject: [imaging] Comment tag problem
>
> Hi, I need some help to find the right tag to use to recreate a tag in a
> jpeg file.
>
> Here is the output of the info given by ImageMagick:
>
>
>
> The tag I need should be under "Properties"
> and be named: comment
>
> I have tried to use user_comment and xpcomment, but they produce something
> different, like:
>
>
>
> Can anyone tell me which tag I can use to generate the "comment" tag?
>
> Thanks for any hint,
> Best regards,
> Andrea
>
>
>

-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org

-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [imaging] Comment tag problem

2018-04-25 Thread Bruno P. Kinoshita
Hi Andrea,
I think you tried to include screenshots? If so, it doesn't work very well in 
this mailing list. Could you try adding as attachment, or upload them, or use 
plain text to describe the issue? I recently had to work on the tags for some 
TIFF & JPEG metadata in [imaging], so hopefully we will be able to locate the 
right tag.
CheersBruno


  From: andrea antonello 
 To: Commons Users List  
 Sent: Wednesday, 25 April 2018 1:56 AM
 Subject: [imaging] Comment tag problem
   
Hi, I need some help to find the right tag to use to recreate a tag in a
jpeg file.

Here is the output of the info given by ImageMagick:



The tag I need should be under "Properties"
and be named: comment

I have tried to use user_comment and xpcomment, but they produce something
different, like:



Can anyone tell me which tag I can use to generate the "comment" tag?

Thanks for any hint,
Best regards,
Andrea


   

Re: [POOL] EvictionTimer daemon thread

2018-01-31 Thread Bruno P. Kinoshita
Not sure if it was intentional.

But here's the reason: 
https://github.com/apache/commons-pool/commit/4a20cdca923bd342360f821d7020538e985d9ec2#diff-38e254894b87bdf9a1758778c7ffd50fL167

Instead of a `new Timer("", /* isDaemon */ true)`, now we have an 
implementation of `ThreadFactory` that when it creates new `Thread`s, it 
doesn't set the `setDaemon(true)`. So it just creates a thread with default 
behaviour of daemon set to false.

As the previous behaviour was to have the threads as daemon, and there doesn't 
seem to have any arguments for dropping it, we could raise a new issue, with a 
patch, and ping Mark to see what he thinks?

Cheers
Bruno

(ps: the threads have a typo in their names, but it has been fixed in the 
master branch already)



From: "Wegrzyn, Jakub" 
To: Commons Users List  
Sent: Wednesday, 31 January 2018 8:54 PM
Subject: RE: [POOL] EvictionTimer daemon thread



I couldn’t find it either.
Pool-351 was a commit message. 
https://git-wip-us.apache.org/repos/asf?p=commons-pool.git;a=commit;h=4a20cdca923bd342360f821d7020538e985d9ec2

Jakub 


-Original Message-
From: Gary Gregory [mailto:garydgreg...@gmail.com] 
Sent: Wednesday, January 31, 2018 8:28 AM
To: Commons Users List 
Subject: Re: [POOL] EvictionTimer daemon thread

I cannot find a POOL-351 issue. Can you double check please?

Gary

On Jan 31, 2018 00:15, "Wegrzyn, Jakub"  wrote:

> Hi,
>
> We want to upgrade dbcp2 from version 2.1.1 to version 2.2.0. It 
> requires upgrading commons-pool2 from version 2.4.2 to 2.5.0. However, 
> during the upgrade we encountered a problem.
> It seems that commons-pool2 Evictor thread has been changed from 
> daemon to non-daemon thread (Issue POOL-351, commit: 
> 4a20cdca923bd342360f821d702053 8e985d9ec2).
>
> We cannot find any documentation describing the reason or the change 
> itself. Can you provide more insight why that was changed and add it 
> to the changes-report.
>
> Best regards,
> Jakub
>
B�CB��[��X��ܚX�KK[XZ[�\�\�][��X��ܚX�P��[[ۜ˘\X�K�ܙ�B��܈Y][ۘ[��[X[��K[XZ[�\�\�Z[��[[ۜ˘\X�K�ܙ�B�

-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: Generate RandomString from a set of characters

2017-10-23 Thread Bruno P. Kinoshita
TIL :-)

Sent from Yahoo Mail on Android 
 
  On Mon, 23 Oct 2017 at 20:39, Pascal Schumacher<pascalschumac...@gmx.net> 
wrote:   Am 23.10.2017 um 05:29 schrieb Bruno P. Kinoshita:
> However, I don't think java faker provides random values based on regular 
> expressions.
By the way java faker can provide random values based on regular 
expressions:

new Faker().regexify(String regex)

It uses Generex to archive this.

Cheers,
Pascal

  


Re: Generate RandomString from a set of characters

2017-10-22 Thread Bruno P. Kinoshita
Hi Philippe,
I believe the Random String generators are using a random number generator, 
combined with some logic for generating codepoints.
But I can see the point for allowing it to generate regular expressions too. 
Might be useful to allow users to generate text from a regular expression too. 
Could you file an issue in JIRA for that?
Perhaps someone will volunteer to work on this. I would start by looking at the 
Builder in RandomStringGenerator, and at the TextRandomProvider interface. 
Perhaps you could create your own, using Generex, and send us the example to 
include in the website documentation?
I normally use [text] random string generator, or java faker [1]. However, I 
don't think java faker provides random values based on regular expressions.
Hope that helpsBruno
[1] https://github.com/DiUS/java-faker

  From: Philippe Mouawad 
 To: Commons Users List  
 Sent: Monday, 23 October 2017 7:34 AM
 Subject: Generate RandomString from a set of characters
   
Hello,
Is it possible in commons-text or commons-lang to generate a Random String
from:

- Either a range of characters defined in a regex ? [a-z][0-9] for example
- Either following a pattern (https://github.com/mifmif/Generex)


Thanks
Regards


   

[ANNOUNCE] Apache Commons CSV 1.5 has been released

2017-09-03 Thread Bruno P. Kinoshita
Hello,

The Apache Commons Community is happy to announce the release of Apache Commons
CSV 1.5. The Apache Commons CSV library provides a simple interface for reading
and writing CSV files of various types.

Source and binary distributions are available for download from the Apache
Commons download site:
 http://commons.apache.org/proper/commons-csv/download_csv.cgi

When downloading, please verify signatures using the KEYS file available at the
above location.

Alternatively the release can be pulled via maven:

  org.apache.commons
  commons-csv
  1.5


The release notes can be viewed at:
 http://www.apache.org/dist/commons/csv/RELEASE-NOTES.txt

For complete information on Commons CSV, including instructions on how to
submit bug reports, patches, or suggestions for improvement, see the Apache
Commons CSV website:

http://commons.apache.org/proper/commons-csv/

Best regards,
Bruno P. Kinoshita
on behalf of the Apache Commons community

-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [imaging] Apache Commons Imaging 1.0 final release ?

2017-08-28 Thread Bruno P. Kinoshita
Hello Olivier!
You are correct, no official release yet. Yet :)
Some days ago I spent some time working on a IIIF PoC with the Cantaloupe 
server, and decided to spend time working on commons-imaging to see what could 
be done to get a first release out.
I started triaging issues, but am far away of understanding the code base or 
understanding the current state of the project. I agree an initial release 
would be good, but I would like some good review to understand what should go 
in a 1.0 release, and what should maybe be removed or moved to a branch for a 
later release.
>From the initial triage, I found that there are some metadata issues with TIFF 
>and JPEG that would impact the use of commons-imaging in IIIF. So I am 
>planning to spend time on that in the next days.
Would you be interested or have time to help reviewing the current state of the 
project? Not necessarily jump and code if you don't have time, but maybe just 
provide feedback on which features you think **must** be in the 1.0 release, 
and if you found anything that would prevent this initial release.
CheersBruno

From: Olivier Jaquemet To: 
"user@commons.apache.org" Sent: Monday, 28 August 
2017, 9:11:08 PM NZSTSubject: [imaging] Apache Commons Imaging 1.0 final 
release ?
Hi imagers :)

As far I could find, no official release of 
org.apache.commons/commons-imaging was ever published to maven.
I understand that the current snapshot build is stable and that previous 
sanselan release are too.
That said, an official build would certainly increase confidence in the 
library and lead to more adoption, don't you think ?

Do you plan to release version 1.0 of Apache Commons Imaging ?

Thanks,
Olivier

-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [CSV] Record Separator query

2017-08-27 Thread Bruno P. Kinoshita
Hi Gary,
+1 for RERO. Everything ready for the vote. Let's see how many RC's I'll need 
to get CSV 1.5 out :)
Thanks!Bruno

From: Gary Gregory <garydgreg...@gmail.com>To: Bruno P. Kinoshita 
<brunodepau...@yahoo.com.br>Cc: Commons Users List 
<user@commons.apache.org>Sent: Sunday, 27 August 2017, 2:20:19 AM NZSTSubject: 
Re: [CSV] Record Separator query
Hi Bruno,

I think it is fine to proceed with a release for 1.5. The code seems stable
to me now. The mutable record issue does not sound settled and fully baked
to me. I like RERO and since you've kindly volunteered to RM this release,
I'd rather not break your stride.

Gary

On Sat, Aug 26, 2017 at 6:34 AM, Bruno P. Kinoshita <
brunodepau...@yahoo.com.br> wrote:

> Ok, so uploaded my keys, followed the steps at https://commons.apache.org/
> releases/prepare.html, used the commit logs in other commons repositories
> to see what was done for a new release.
>
> I stopped just before the step to Tag the Release Candidate.
>
> Should I proceed and give it a try at my first attempt at releasing a
> commons component and prepare the vote for CSV 1.5 RC1?
>
> Or should we wait for the mutable record ongoing discussion in the mailing
> list?
>
> If anyone would like to take a peek and check if I missed anything before
> I call the vote, any feedback would be welcome :)
> https://github.com/apache/commons-csv/compare/release...
> kinow:release?expand=1
>
> Cheers
> Bruno
>
>
> 
> From: Gary Gregory <garydgreg...@gmail.com>
> To: Commons Users List <user@commons.apache.org>; Bruno P. Kinoshita <
> brunodepau...@yahoo.com.br>
> Sent: Sunday, 13 August 2017, 4:24:34 PM NZST
> Subject: Re: [CSV] Record Separator query
>
> On Sat, Aug 12, 2017 at 8:48 PM, Bruno P. Kinoshita <
> brunodepau...@yahoo.com.br.invalid> wrote:
> > Hmmm, for a while I have been considering learning how to release
> Commons components. Maybe I could start with Commons CSV, though I could do
> with some help :) I will start reading the docs at
> https://commons.apache.org/ releases/index.html. Is there anything else I
> need to know to act as RM?
>
> Patience :-) there are lots of details.
>
> Gary
>
> >  CheersBruno
> >
> >
> > On Sunday, 13 August 2017, 4:08:36 AM NZST, Gary Gregory <
> garydgreg...@gmail.com> wrote:
> >
> > There is no one currently slated to volunteer to RM the release. Good
> time
> > to ask though!
> >
> > Do have a committer here willing to volunteer to release Commons CSV 1.5?
> >
> > Thank you,
> > Gary
> >
> > On Fri, Aug 11, 2017 at 3:27 PM, nitin mahendru <
> nitin.mahendr...@gmail.com>
> > wrote:
> >
> >> Thanks for accepting the pull request.
> >> Any pointers on when the version 1.5 will be released ?
> >>
> >>
> >>
> >>
> >> On Thu, Aug 10, 2017 at 2:19 PM nitin mahendru <
> nitin.mahendr...@gmail.com
> >> >
> >> wrote:
> >>
> >> > Thanks Greg.
> >> > Well the problem actually was that I am behind a proxy.  So my
> mistake.
> >> > Sorry for that.
> >> >
> >> > I have raised a pull request and a JIRA item CSV-214. Looking forward
> to
> >> > your feedback.
> >> >
> >> > Thanks
> >> >
> >> > Nitin
> >> >
> >> >
> >> >
> >> >
> >> > On Thu, Aug 10, 2017 at 1:08 PM Gary Gregory <garydgreg...@gmail.com>
> >> > wrote:
> >> >
> >> >> Use the button provided by GitHub to copy the repo URL to the
> clipboard,
> >> >> then you can just use "git clone "
> >> >>
> >> >> On Thu, Aug 10, 2017 at 1:05 PM, nitin mahendru <
> >> >> nitin.mahendr...@gmail.com>
> >> >> wrote:
> >> >>
> >> >> > Hello All,
> >> >> >
> >> >> > I raised a JIRA ticket(CSV-214) to make some changes to the code
> for
> >> >> what I
> >> >> > a trying to do. The description on the ticket might help explain
> >> things
> >> >> > better. Now I am trying to clone the repo to make a pull request
> but I
> >> >> am
> >> >> > just stuck at this:
> >> >> >
> >> >> > git -c http.sslVerify=false clone https://github.com/apache/
> >> >> > commons-csv.git
> >> >> > Cloning into 'commons-csv'...
> >> >> > fatal: https://github.co

Re: [CSV] Record Separator query

2017-08-26 Thread Bruno P. Kinoshita
Ok, so uploaded my keys, followed the steps at 
https://commons.apache.org/releases/prepare.html, used the commit logs in other 
commons repositories to see what was done for a new release.

I stopped just before the step to Tag the Release Candidate.

Should I proceed and give it a try at my first attempt at releasing a commons 
component and prepare the vote for CSV 1.5 RC1?

Or should we wait for the mutable record ongoing discussion in the mailing list?

If anyone would like to take a peek and check if I missed anything before I 
call the vote, any feedback would be welcome :) 
https://github.com/apache/commons-csv/compare/release...kinow:release?expand=1

Cheers
Bruno



From: Gary Gregory <garydgreg...@gmail.com>
To: Commons Users List <user@commons.apache.org>; Bruno P. Kinoshita 
<brunodepau...@yahoo.com.br>
Sent: Sunday, 13 August 2017, 4:24:34 PM NZST
Subject: Re: [CSV] Record Separator query

On Sat, Aug 12, 2017 at 8:48 PM, Bruno P. Kinoshita 
<brunodepau...@yahoo.com.br.invalid> wrote:
> Hmmm, for a while I have been considering learning how to release Commons 
> components. Maybe I could start with Commons CSV, though I could do with some 
> help :) I will start reading the docs at https://commons.apache.org/ 
> releases/index.html. Is there anything else I need to know to act as RM?

Patience :-) there are lots of details.

Gary
 
>  CheersBruno
> 
> 
> On Sunday, 13 August 2017, 4:08:36 AM NZST, Gary Gregory 
> <garydgreg...@gmail.com> wrote:
> 
> There is no one currently slated to volunteer to RM the release. Good time
> to ask though!
> 
> Do have a committer here willing to volunteer to release Commons CSV 1.5?
> 
> Thank you,
> Gary
> 
> On Fri, Aug 11, 2017 at 3:27 PM, nitin mahendru <nitin.mahendr...@gmail.com>
> wrote:
> 
>> Thanks for accepting the pull request.
>> Any pointers on when the version 1.5 will be released ?
>>
>>
>>
>>
>> On Thu, Aug 10, 2017 at 2:19 PM nitin mahendru <nitin.mahendr...@gmail.com
>> >
>> wrote:
>>
>> > Thanks Greg.
>> > Well the problem actually was that I am behind a proxy.  So my mistake.
>> > Sorry for that.
>> >
>> > I have raised a pull request and a JIRA item CSV-214. Looking forward to
>> > your feedback.
>> >
>> > Thanks
>> >
>> > Nitin
>> >
>> >
>> >
>> >
>> > On Thu, Aug 10, 2017 at 1:08 PM Gary Gregory <garydgreg...@gmail.com>
>> > wrote:
>> >
>> >> Use the button provided by GitHub to copy the repo URL to the clipboard,
>> >> then you can just use "git clone "
>> >>
>> >> On Thu, Aug 10, 2017 at 1:05 PM, nitin mahendru <
>> >> nitin.mahendr...@gmail.com>
>> >> wrote:
>> >>
>> >> > Hello All,
>> >> >
>> >> > I raised a JIRA ticket(CSV-214) to make some changes to the code for
>> >> what I
>> >> > a trying to do. The description on the ticket might help explain
>> things
>> >> > better. Now I am trying to clone the repo to make a pull request but I
>> >> am
>> >> > just stuck at this:
>> >> >
>> >> > git -c http.sslVerify=false clone https://github.com/apache/
>> >> > commons-csv.git
>> >> > Cloning into 'commons-csv'...
>> >> > fatal: https://github.com/apache/ commons-csv.git/info/refs not valid:
>> >> is
>> >> > this a git repository?
>> >> >
>> >> >
>> >> > Any Idea about this ?
>> >> >
>> >> > Thanks
>> >> >
>> >> > Nitin
>> >> >
>> >> >
>> >> >
>> >> >
>> >> >
>> >> > On Wed, Aug 9, 2017 at 5:17 PM Gary Gregory <garydgreg...@gmail.com>
>> >> > wrote:
>> >> >
>> >> > > On Wed, Aug 9, 2017 at 5:04 PM, Guang Chao <
>> guang.chao.1...@gmail.com
>> >> >
>> >> > > wrote:
>> >> > >
>> >> > > > On Wed, Aug 9, 2017 at 6:12 AM, nitin mahendru <
>> >> > > nitin.mahendr...@gmail.com
>> >> > > > >
>> >> > > > wrote:
>> >> > > >
>> >> > > > > Hello All,
>> >> > > > >
>> >> > > > > I am trying to read in a csv file which may be 'crlf' or 'lf'
>> >> > > seperated.
>> >> > &

Re: [CSV] Record Separator query

2017-08-12 Thread Bruno P. Kinoshita
Hmmm, for a while I have been considering learning how to release Commons 
components. Maybe I could start with Commons CSV, though I could do with some 
help :) I will start reading the docs at 
https://commons.apache.org/releases/index.html. Is there anything else I need 
to know to act as RM?
CheersBruno

On Sunday, 13 August 2017, 4:08:36 AM NZST, Gary Gregory 
 wrote:

There is no one currently slated to volunteer to RM the release. Good time
to ask though!

Do have a committer here willing to volunteer to release Commons CSV 1.5?

Thank you,
Gary

On Fri, Aug 11, 2017 at 3:27 PM, nitin mahendru 
wrote:

> Thanks for accepting the pull request.
> Any pointers on when the version 1.5 will be released ?
>
>
>
>
> On Thu, Aug 10, 2017 at 2:19 PM nitin mahendru  >
> wrote:
>
> > Thanks Greg.
> > Well the problem actually was that I am behind a proxy.  So my mistake.
> > Sorry for that.
> >
> > I have raised a pull request and a JIRA item CSV-214. Looking forward to
> > your feedback.
> >
> > Thanks
> >
> > Nitin
> >
> >
> >
> >
> > On Thu, Aug 10, 2017 at 1:08 PM Gary Gregory 
> > wrote:
> >
> >> Use the button provided by GitHub to copy the repo URL to the clipboard,
> >> then you can just use "git clone "
> >>
> >> On Thu, Aug 10, 2017 at 1:05 PM, nitin mahendru <
> >> nitin.mahendr...@gmail.com>
> >> wrote:
> >>
> >> > Hello All,
> >> >
> >> > I raised a JIRA ticket(CSV-214) to make some changes to the code for
> >> what I
> >> > a trying to do. The description on the ticket might help explain
> things
> >> > better. Now I am trying to clone the repo to make a pull request but I
> >> am
> >> > just stuck at this:
> >> >
> >> > git -c http.sslVerify=false clone https://github.com/apache/
> >> > commons-csv.git
> >> > Cloning into 'commons-csv'...
> >> > fatal: https://github.com/apache/commons-csv.git/info/refs not valid:
> >> is
> >> > this a git repository?
> >> >
> >> >
> >> > Any Idea about this ?
> >> >
> >> > Thanks
> >> >
> >> > Nitin
> >> >
> >> >
> >> >
> >> >
> >> >
> >> > On Wed, Aug 9, 2017 at 5:17 PM Gary Gregory 
> >> > wrote:
> >> >
> >> > > On Wed, Aug 9, 2017 at 5:04 PM, Guang Chao <
> guang.chao.1...@gmail.com
> >> >
> >> > > wrote:
> >> > >
> >> > > > On Wed, Aug 9, 2017 at 6:12 AM, nitin mahendru <
> >> > > nitin.mahendr...@gmail.com
> >> > > > >
> >> > > > wrote:
> >> > > >
> >> > > > > Hello All,
> >> > > > >
> >> > > > > I am trying to read in a csv file which may be 'crlf' or 'lf'
> >> > > seperated.
> >> > > > > Then I want to change a particular column, say encrypt it and
> then
> >> > > write
> >> > > > > back a new csv with that updated column. I want to use the same
> >> > record
> >> > > > > separator as was in the input file.
> >> > > > >
> >> > > > > Is there a way to get the record separator back from the
> CSVParser
> >> > > > object ?
> >> > > > > I am planning to use the below method to get the writer.
> >> > > > > CSVFormat.RFC4180.withRecordSeparator( >> > > > > separator).print()
> >> > > > >
> >> > > > > For using the above I need to know the record separator upfront
> >> > which I
> >> > > > > have no clue about as the Parser object does not expose that
> >> detail.
> >> > > > >
> >> > > > > thanks
> >> > > > >
> >> > > > > Nitin
> >> > > > >
> >> > > >
> >> > > > I think CSVParser is strict and may not work for both LF and CRLF.
> >> > Maybe
> >> > > > try to scan the file first and see if line ending is lf or crlf,
> and
> >> > then
> >> > > > use a corresponding CSVParser instance that can handle each case.
> >> > > >
> >> > >
> >> > > That's not how it works now but feel free to provide a PR on GitHub
> >> ;-)
> >> > >
> >> > > Gary
> >> > >
> >> > > >
> >> > > > --
> >> > > > Guang  >
> >> > > >
> >> > >
> >> >
> >>
> >
>


Re: [jxpath] How to add an entry to a list?

2017-06-15 Thread Bruno P. Kinoshita
>Ok.  Does it seem like mitigating this might be a reasonable enhancement for 
>JXPath?  I don't know yet how it would work, but I see it as a flag that when 
>on, would simply deal with this by extending the list automatically.

I am not sure. You can file an issue for that if you'd like. From what I 
understood reading some parts of the code (e.g. ValueUtils#setValue) this is by 
design. You are using a List, so that worked in your case. But should you had 
another collection, I believe you would get a UnsupportedOperationException.


There may be other approaches to solving this issue that I am not aware of. But 
in case you build a good argument in your issue in JIRA, it may be implemented 
in jxpath.

Cheers
Bruno


From: "KARR, DAVID" <dk0...@att.com>
To: Commons Users List <user@commons.apache.org>; Bruno P. Kinoshita 
<brunodepau...@yahoo.com.br> 
Sent: Friday, 16 June 2017 3:37 AM
Subject: RE: [jxpath] How to add an entry to a list?



> -----Original Message-
> From: Bruno P. Kinoshita [mailto:brunodepau...@yahoo.com.br.INVALID]
> Sent: Thursday, June 15, 2017 2:51 AM
> To: Commons Users List <user@commons.apache.org>
> Subject: Re: [jxpath] How to add an entry to a list?
> 
> Thanks for the link David. Posted a complete reply there, but here's the
> TL;DR.
> 
> The only way I found of doing that, was by pre-populating your list with
> an empty element. That way, /numbers[1] calls List#set(0, "123") with no
> exceptions.

Ok.  Does it seem like mitigating this might be a reasonable enhancement for 
JXPath?  I don't know yet how it would work, but I see it as a flag that when 
on, would simply deal with this by extending the list automatically.

> 
> From: "KARR, DAVID" <dk0...@att.com>
> To: Commons Users List <user@commons.apache.org>; Bruno P. Kinoshita
> <brunodepau...@yahoo.com.br>
> Sent: Thursday, 15 June 2017 3:13 AM
> Subject: RE: [jxpath] How to add an entry to a list?
> 
> 
> 
> > -Original Message-
> > From: Bruno P. Kinoshita [mailto:brunodepau...@yahoo.com.br.INVALID]
> > Sent: Wednesday, June 14, 2017 3:18 AM
> > To: Commons Users List <user@commons.apache.org>
> > Subject: Re: [jxpath] How to add an entry to a list?
> >
> > Hi David,
> >
> > Do you have some code you could share? Maybe looking at your code
> others
> > (I would try as well, but can't promise will know how to help) might
> be
> > able to help.
> 
> Thanks for replying.  I posted more detailed code samples on SO:
> https://urldefense.proofpoint.com/v2/url?u=https-
> 3A__stackoverflow.com_questions_44530112_how-2Dto-2Dget-2Djxpath-2Dto-
> 2Dcleanly-2Dset-2Dlist-2Dcollection-2Dentries=DwIFaQ=LFYZ-
> o9_HUMeMTSQicvjIg=OsTemSXEn-xy2uk0vYF_EA=nfT2LEhdW7RV4azBV5z7cO-
> vMKzYetKiHBtDCkt0CoI=AXR_qT2s9pltw3Q7IPZwifyv91V3YxSISo5Jt_B3KE4=  .
> 
> > 
> > From: "KARR, DAVID" <dk0...@att.com>
> > To: Commons Users List <user@commons.apache.org>
> > Sent: Wednesday, 14 June 2017 6:11 AM
> > Subject: [jxpath] How to add an entry to a list?
> >
> >
> >
> > If a property in a bean I'm trying to manipulate with jxpath is a
> List,
> > how do I set a value in an entry of that list?
> >
> >
> > I read the info at "Modifying Object Graphs", but it's still not clear
> > from this how I would do this.
> >
> >
> > I've figured out how to get the list created, either with an explicit
> > "setValue()", or with a "createPathAndSetValue()" along with a factory
> > and createObject() method set to look for that property, but if I try
> to
> > set a value into the list, it fails apparently because the list is
> still
> > zero size.
> >
> >
> > The only way I can hack this to work is to initialize the list
> property
> > to an ArrayList with the required number of dummy elements already
> added
> > to it, so the subscript reference works.
> >
> >
> > I'm using JXPath so that I can write tests with a little less
> > boilerplate and focus on pure business logic.  Ideally, I'd like
> JXPath
> > (or perhaps a factory) to do the "obvious stuff".
> >
> >
> >
> > -
> >
> > To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> >
> > For additional commands, e-mail: user-h...@commons.apache.org
> 
> >
> > -
> > To unsubscribe, e-mail: use

Re: [jxpath] How to add an entry to a list?

2017-06-15 Thread Bruno P. Kinoshita
Thanks for the link David. Posted a complete reply there, but here's the TL;DR.

The only way I found of doing that, was by pre-populating your list with an 
empty element. That way, /numbers[1] calls List#set(0, "123") with no 
exceptions.

Hope that helps
Bruno




From: "KARR, DAVID" <dk0...@att.com>
To: Commons Users List <user@commons.apache.org>; Bruno P. Kinoshita 
<brunodepau...@yahoo.com.br> 
Sent: Thursday, 15 June 2017 3:13 AM
Subject: RE: [jxpath] How to add an entry to a list?



> -----Original Message-
> From: Bruno P. Kinoshita [mailto:brunodepau...@yahoo.com.br.INVALID]
> Sent: Wednesday, June 14, 2017 3:18 AM
> To: Commons Users List <user@commons.apache.org>
> Subject: Re: [jxpath] How to add an entry to a list?
> 
> Hi David,
> 
> Do you have some code you could share? Maybe looking at your code others
> (I would try as well, but can't promise will know how to help) might be
> able to help.

Thanks for replying.  I posted more detailed code samples on SO: 
https://stackoverflow.com/questions/44530112/how-to-get-jxpath-to-cleanly-set-list-collection-entries
 .

> 
> From: "KARR, DAVID" <dk0...@att.com>
> To: Commons Users List <user@commons.apache.org>
> Sent: Wednesday, 14 June 2017 6:11 AM
> Subject: [jxpath] How to add an entry to a list?
> 
> 
> 
> If a property in a bean I'm trying to manipulate with jxpath is a List,
> how do I set a value in an entry of that list?
> 
> 
> I read the info at "Modifying Object Graphs", but it's still not clear
> from this how I would do this.
> 
> 
> I've figured out how to get the list created, either with an explicit
> "setValue()", or with a "createPathAndSetValue()" along with a factory
> and createObject() method set to look for that property, but if I try to
> set a value into the list, it fails apparently because the list is still
> zero size.
> 
> 
> The only way I can hack this to work is to initialize the list property
> to an ArrayList with the required number of dummy elements already added
> to it, so the subscript reference works.
> 
> 
> I'm using JXPath so that I can write tests with a little less
> boilerplate and focus on pure business logic.  Ideally, I'd like JXPath
> (or perhaps a factory) to do the "obvious stuff".
> 
> 
> 
> -
> 
> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> 
> For additional commands, e-mail: user-h...@commons.apache.org

> 
> -
> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> For additional commands, e-mail: user-h...@commons.apache.org

Т�ХF�V�7V'67&��R���âW6W"�V�7V'67&��2�6�R��Фf�"FF�F6G2�R���âW6W"ֆV�6�2�6�R��Р

-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [jxpath] How to add an entry to a list?

2017-06-14 Thread Bruno P. Kinoshita
Hi David,

Do you have some code you could share? Maybe looking at your code others (I 
would try as well, but can't promise will know how to help) might be able to 
help.

Cheers
Bruno



From: "KARR, DAVID" 
To: Commons Users List  
Sent: Wednesday, 14 June 2017 6:11 AM
Subject: [jxpath] How to add an entry to a list?



If a property in a bean I'm trying to manipulate with jxpath is a List, how do 
I set a value in an entry of that list?


I read the info at "Modifying Object Graphs", but it's still not clear from 
this how I would do this.


I've figured out how to get the list created, either with an explicit 
"setValue()", or with a "createPathAndSetValue()" along with a factory and 
createObject() method set to look for that property, but if I try to set a 
value into the list, it fails apparently because the list is still zero size.


The only way I can hack this to work is to initialize the list property to an 
ArrayList with the required number of dummy elements already added to it, so 
the subscript reference works.


I'm using JXPath so that I can write tests with a little less boilerplate and 
focus on pure business logic.  Ideally, I'd like JXPath (or perhaps a factory) 
to do the "obvious stuff".



-

To unsubscribe, e-mail: user-unsubscr...@commons.apache.org

For additional commands, e-mail: user-h...@commons.apache.org

-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [validator] DomainValidator instance thread-safe?

2015-05-02 Thread Bruno P. Kinoshita
Had just looked through its code and was about to do the same :)
Looks immutable and thread-safe to me too, though I just quickly inspected with 
vim. Going to read it again in Eclipse later and watch VALIDATOR-366.

Thanks
Bruno
 
  From: Benedikt Ritter brit...@apache.org
 To: Commons Users List user@commons.apache.org 
 Sent: Saturday, May 2, 2015 10:51 AM
 Subject: Re: [validator] DomainValidator instance thread-safe?
   
Hello Cyrill,

2015-05-01 17:44 GMT+02:00 Cyril coder...@gmail.com:

 Hello,
 I am interested by using a few validator routines such as the
 DomainValidator (package org.apache.commons.validator.routines). However,
 looking at the javadoc, I cannot find information about thread-safety in
 the description.

 Is DomainValidator#getInstance() and resulting DomainValidator instance
 thread-safe?


I've looked through the code of DomainValidator. It is immutable so
instances can be shared between threads. I've also created VALIDATOR-366
[1] for documenting this for all validators.

Thank you!
Benedikt

[1] https://issues.apache.org/jira/browse/VALIDATOR-366





 Thank you.

 Regards,
 Cyril




-- 
http://people.apache.org/~britter/
http://www.systemoutprintln.de/
http://twitter.com/BenediktRitter
http://github.com/britter