使用exec给出不同输出的相同命令

时间:2017-06-07 05:26:36

标签: java apache centos6 apache-tika

我正在从一台服务器迁移到另一台服务器,并看到相同的exec命令提供不同的输出。我不确定我需要检查和确保我看到一致的输出

Example of the command that is executed:



java -jar /var/www/html/PhpTikaWrapper-master/vendor/tika-app-1.5.jar -m one.jpg

1)服务器1(这就是我想要的)

Array
(
    [0] => Chroma BlackIsZero: true
    [1] => Chroma ColorSpaceType: RGB
    [2] => Chroma NumChannels: 4
    [3] => Compression CompressionTypeName: deflate
    [4] => Compression Lossless: true
    [5] => Compression NumProgressiveScans: 1
    [6] => Content-Length: 9371
    [7] => Content-Type: image/png
    [8] => Data BitsPerSample: 8 8 8 8
    [9] => Data PlanarConfiguration: PixelInterleaved
    [10] => Data SampleFormat: UnsignedIntegral
    [11] => Dimension ImageOrientation: Normal
    [12] => Dimension PixelAspectRatio: 1.0
    [13] => IHDR: width=150, height=75, bitDepth=8, colorType=RGBAlpha, compressionMethod=deflate, filterMethod=adaptive, interlaceMethod=none
    [14] => Text TextEntry: keyword=Software, value=Adobe ImageReady, encoding=ISO-8859-1, compression=none
    [15] => Transparency Alpha: nonpremultipled
    [16] => height: 75
    [17] => resourceName: Orca-logo.png
    [18] => tEXt tEXtEntry: keyword=Software, value=Adobe ImageReady
    [19] => tiff:BitsPerSample: 8 8 8 8
    [20] => tiff:ImageLength: 75
    [21] => tiff:ImageWidth: 150
    [22] => width: 150
)

服务器2(这是我在新服务器中获得的内容):

Array
(
    [0] => Comments: Lavc56.5.100
    [1] => Component 1: Y component: Quantization table 0, Sampling factors 2 horiz/2 vert
    [2] => Component 2: Cb component: Quantization table 0, Sampling factors 1 horiz/1 vert
    [3] => Component 3: Cr component: Quantization table 0, Sampling factors 1 horiz/1 vert
    [4] => Compression Type: Baseline
    [5] => Content-Length: 25259
    [6] => Content-Type: image/jpeg
    [7] => Data Precision: 8 bits
    [8] => Image Height: 840 pixels
    [9] => Image Width: 840 pixels
    [10] => Jpeg Comment: Lavc56.5.100
    [11] => Number of Components: 3
    [12] => Resolution Units: none
    [13] => X Resolution: 1 dot
    [14] => Y Resolution: 1 dot
    [15] => comment: Lavc56.5.100
    [16] => resourceName: ankita2_comp.jpg
    [17] => tiff:BitsPerSample: 8
    [18] => tiff:ImageLength: 840
    [19] => tiff:ImageWidth: 840
    [20] => w:comments: Lavc56.5.100
)

两台服务器上的Java版本相同,如下所示

java version "1.7.0_141"
OpenJDK Runtime Environment (rhel-2.6.10.1.el6_9-x86_64 u141-b02)
OpenJDK 64-Bit Server VM (build 24.141-b02, mixed mode)

此外,该命令不会在新服务器上返回宽度。

任何帮助将不胜感激。感谢。

1 个答案:

答案 0 :(得分:0)

我已经确定了这个问题,实际上apache tikka为不同的文件类型提供了不同的响应格式。

对于JPEG,我们会得到不同的响应,对于png,我会得到一个不同的响应,因为我已经超越了。

希望这能节省一些时间。