pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1840838 - /pdfbox/branches/2.0/debugger/src/main/java/org/apache/pdfbox/debugger/streampane/StreamPane.java
Date Thu, 13 Sep 2018 16:44:29 GMT
Author: tilman
Date: Thu Sep 13 16:44:29 2018
New Revision: 1840838

URL: http://svn.apache.org/viewvc?rev=1840838&view=rev
Log:
PDFBOX-2941: don't display hex pane when displaying an image, don't create a stream from a
temporary created jpeg image, change tabbed pane names

Modified:
    pdfbox/branches/2.0/debugger/src/main/java/org/apache/pdfbox/debugger/streampane/StreamPane.java

Modified: pdfbox/branches/2.0/debugger/src/main/java/org/apache/pdfbox/debugger/streampane/StreamPane.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/debugger/src/main/java/org/apache/pdfbox/debugger/streampane/StreamPane.java?rev=1840838&r1=1840837&r2=1840838&view=diff
==============================================================================
--- pdfbox/branches/2.0/debugger/src/main/java/org/apache/pdfbox/debugger/streampane/StreamPane.java
(original)
+++ pdfbox/branches/2.0/debugger/src/main/java/org/apache/pdfbox/debugger/streampane/StreamPane.java
Thu Sep 13 16:44:29 2018
@@ -30,7 +30,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.Vector;
 import java.util.concurrent.ExecutionException;
-import javax.imageio.ImageIO;
 import javax.swing.BoxLayout;
 import javax.swing.JComboBox;
 import javax.swing.JComponent;
@@ -146,8 +145,15 @@ public class StreamPane implements Actio
         }
 
         tabbedPane = new JTabbedPane();
-        tabbedPane.add("Text view", view.getStreamPanel());
-        tabbedPane.add("Hex view", hexView.getPane());
+        if (stream.isImage())
+        {
+            tabbedPane.add("Image view", view.getStreamPanel());
+        }
+        else
+        {
+            tabbedPane.add("Text view", view.getStreamPanel());
+            tabbedPane.add("Hex view", hexView.getPane());
+        }
 
         panel.add(tabbedPane);
     }
@@ -182,8 +188,13 @@ public class StreamPane implements Actio
                 if (currentFilter.equals(Stream.IMAGE))
                 {
                     requestImageShowing();
+                    tabbedPane.removeAll();
+                    tabbedPane.add("Image view", view.getStreamPanel());
                     return;
                 }
+                tabbedPane.removeAll();
+                tabbedPane.add("Text view", view.getStreamPanel());
+                tabbedPane.add("Hex view", hexView.getPane());
                 requestStreamText(currentFilter);
             }
             catch (IOException e)
@@ -208,13 +219,6 @@ public class StreamPane implements Actio
                 return;
             }
             view.showStreamImage(image);
-
-            ByteArrayOutputStream baos = new ByteArrayOutputStream();
-            ImageIO.write(image, "jpg", baos);
-            baos.flush();
-            byte[] bytes = baos.toByteArray();
-            baos.close();
-            hexView.changeData(bytes);
         }
     }
 



Mime
View raw message