- Timestamp:
- Feb 27, 2011, 1:38:04 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/service/ImageService.java
r9387 r9392 9 9 import fr.mael.jiwigo.transverse.session.SessionManager; 10 10 import fr.mael.jiwigo.transverse.util.ImagesUtil; 11 import fr.mael.jiwigo.transverse.util. Outil;11 import fr.mael.jiwigo.transverse.util.Tools; 12 12 13 13 /* … … 78 78 * Lists all images for a category 79 79 * @param categoryId the id of the category 80 * @param rafraichir true : refresh the list of images81 80 * @return the list of images 82 81 * @throws IOException 83 82 */ 84 public List<Image> list erParCategory(Integer categoryId, boolean rafraichir) throws IOException {85 return ImageDao.getInstance(sessionManager).list erParCategory(categoryId, rafraichir);83 public List<Image> listByCategory(Integer categoryId, boolean rafraichir) throws IOException { 84 return ImageDao.getInstance(sessionManager).listByCategory(categoryId, rafraichir); 86 85 } 87 86 … … 92 91 * @param originalWidth width for the original image 93 92 * @param originalHeight height for the original image 94 * @return 93 * @return true if the image is created 95 94 * @throws Exception 96 95 */ 97 public boolean cre er(String filePath, Integer idCategory, Integer originalWidth, Integer originalHeight,96 public boolean create(String filePath, Integer idCategory, Integer originalWidth, Integer originalHeight, 98 97 Double chunckSize, Integer privacyLevel) throws Exception { 99 98 File originalFile = new File(filePath); 100 99 //get the byte array of the original file, to keep metadata 101 byte[] bytesFichierOriginal = Outil.getBytesFromFile(originalFile);100 byte[] bytesFichierOriginal = Tools.getBytesFromFile(originalFile); 102 101 103 102 //resize the picture (or not) … … 114 113 //the methode Outil.enrich will fail, but the procedure has to continue 115 114 try { 116 byte[] fichierEnrichi = Outil.enrich(bytesFichierOriginal, Outil.getBytesFromFile(new File(System115 byte[] fichierEnrichi = Tools.enrich(bytesFichierOriginal, Tools.getBytesFromFile(new File(System 117 116 .getProperty("java.io.tmpdir") 118 117 + "/originale.jpg"))); 119 Outil.byteToFile(System.getProperty("java.io.tmpdir") + "/originale.jpg", fichierEnrichi);118 Tools.byteToFile(System.getProperty("java.io.tmpdir") + "/originale.jpg", fichierEnrichi); 120 119 } catch (Exception e) { 121 120 } … … 131 130 image.setPrivacyLevel(String.valueOf(privacyLevel)); 132 131 //now we call the dao to send the image to the webservice 133 return ImageDao.getInstance(sessionManager).cre er(image, chunckSize);132 return ImageDao.getInstance(sessionManager).create(image, chunckSize); 134 133 } 135 134 … … 142 141 */ 143 142 public boolean addTags(Image image, String tagId) throws IOException { 144 return ImageDao.getInstance(sessionManager).addTags(image.getIdentifi ant(), tagId);143 return ImageDao.getInstance(sessionManager).addTags(image.getIdentifier(), tagId); 145 144 } 146 145
Note: See TracChangeset
for help on using the changeset viewer.