Changeset 1427 for trunk/src/org/expeditee/items/Picture.java
- Timestamp:
- 08/07/19 14:14:42 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/items/Picture.java
r1426 r1427 37 37 import org.expeditee.core.bounds.AxisAlignedBoxBounds; 38 38 import org.expeditee.core.bounds.PolygonBounds; 39 import org.expeditee.encryption.core.EncryptedImage; 40 import org.expeditee.encryption.items.surrogates.Label; 41 import org.expeditee.encryption.items.surrogates.Label.LabelResult; 39 42 import org.expeditee.gio.EcosystemManager; 40 43 import org.expeditee.gio.GraphicsManager; … … 42 45 import org.expeditee.gui.FrameIO; 43 46 import org.expeditee.gui.FrameUtils; 47 import org.expeditee.gui.MessageBay; 44 48 45 49 /** … … 62 66 public class Picture extends XRayable { 63 67 64 public static final String REDACTED_IMAGE_NAME = " redacted.png";68 public static final String REDACTED_IMAGE_NAME = "expeditee_noise.encrypted"; 65 69 66 70 private static final float CROPPING_COMPOSITE_ALPHA = 0.5f; … … 775 779 @Override 776 780 public boolean refresh() { 777 // ImageIcon is faster, but cannot handle some formats778 // (notably.bmp) hence, we try this first, then if it fails we try779 // ImageIO780 /*781 try {782 _image = new ImageIcon(_path).getImage();783 } catch (Exception e) {784 }785 786 // if ImageIcon failed to read the image787 if (_image == null || _image.getWidth() <= 0) {788 try {789 _image = ImageIO.read(new File(_path));790 } catch (IOException e) {791 // e.printStackTrace();792 Logger.Log(e);793 _image = null;794 return false;795 }796 }797 */798 799 781 if (isNoise()) { 800 _image = Image.getNoise();782 _image = EncryptedImage.getNoise(); 801 783 } else { 802 _image = Image.getImage(_path); 784 String encryptionLabel = _source.getEncryptionLabel(); 785 if (encryptionLabel == null || encryptionLabel.isEmpty()) { 786 _image = Image.getImage(_path); 787 } else { 788 LabelResult result = Label.getLabel(encryptionLabel); 789 if (result == LabelResult.SuccessResolveLabelToKey) { 790 _image = EncryptedImage.getImage(_path, result.key); 791 } else { 792 MessageBay.displayMessage(result.toString()); 793 _image = EncryptedImage.getNoise(); 794 } 795 } 803 796 } 804 797
Note:
See TracChangeset
for help on using the changeset viewer.