12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- angular.module('codexApp')
- .service('ThumbnailService', [ '$rootScope', '$http', function($rootScope, $http) {
- var createThumbnail = function(file_path) {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- }
- var getThumbnailName = function(file_path) {
- var filename = file_path.split('\\').pop().split('/').pop();
- var name = filename.split('.');
-
- var path = file_path.split('/');
- path.pop();
- var thumb_path = path.join('/');
- return thumb_path + "/" + name[0] + ".thumb.png";
- }
- var thumbnailExists = function(file_path) {
- var url = getThumbnailName(file_path);
-
-
-
-
-
-
- var fs = require('fs');
- return fs.existsSync(url);
- }
- this.createNoteThumbnail = function(file_path) {
- if(thumbnailExists(file_path) == false){
- return createThumbnail(file_path);
- }
- return getThumbnailName(file_path);
- }
- }])
|