Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with the Upload and the Thumbnails images #78

Open
rortegar opened this issue Sep 24, 2015 · 3 comments
Open

Problems with the Upload and the Thumbnails images #78

rortegar opened this issue Sep 24, 2015 · 3 comments

Comments

@rortegar
Copy link

Hello there,
I found some problems with the creation of the thumbnails, I have the bundle install and configured successful. But the problem is when you upload a PDF file the internal logic creates a thumbnail image.

It creates the image (using "imagick") inside the folder thumbnails, but also it creates another one inside the folder "originals".... And this is not correct because it should only create one image file...

So I found the problem inside the file "symfony2-file-uploader-bundle/BlueImp/UploadHandler.php"
in the function "create_scaled_image" at the moment that it creates the image it should use the variable "$new_file_path instead" the "$file_path".

So the code will be something like:
protected function create_scaled_image($file_name, $options) {
...
$new_file_path .= '.png';
$im->writeImage($new_file_path);
....
}
And with this change it is working fine!

Another problem that I found is that is not possible to choose which extension is going to have thumbnails...
Inside the same file it contains the variable
'ps_file_extensions' => array(
'ai',
'psd',
'pdf',
'eps'
That is not possible to override!
Will it be possible to do something here? Can it the other problem solve for the next version? Thank you!

@boutell
Copy link
Member

boutell commented Sep 24, 2015

If it is created in both places, I'm not sure that's not deliberate?

On Thu, Sep 24, 2015 at 8:29 AM, rortegar [email protected] wrote:

Hello there,
I found some problems with the creation of the thumbnails, I have the
bundle install and configured successful. But the problem is when you
upload a PDF file the internal logic creates a thumbnail image.

It creates the image (using "imagick") inside the folder thumbnails, but
also it creates another one inside the folder "originals".... And this is
not correct because it should only create one image file...

So I found the problem inside the file
"symfony2-file-uploader-bundle/BlueImp/UploadHandler.php"
in the function "create_scaled_image" at the moment that it creates the
image it should use the variable "$new_file_path instead" the "$file_path".

So the code will be something like:
protected function create_scaled_image($file_name, $options) {
...
$new_file_path .= '.png';
$im->writeImage($new_file_path);
....
}
And with this change it is working fine!

Another problem that I found is that is not possible to choose which
extension is going to have thumbnails...
Inside the same file it contains the variable


Reply to this email directly or view it on GitHub
#78.

*THOMAS BOUTELL, *DEV & OPS
P'UNK AVENUE | (215) 755-1330 | punkave.com

@rortegar
Copy link
Author

Hello! thank you for your answer, I am not really sure about the logic inside, but In my case it should not create it two times, do you know if there is some parameter or something that I can set to avoid this?
About the other problem do you know how can I override the extensions that are going to be used to create the images (ps_file_extensions)?
Than you very much for your help!

@boutell
Copy link
Member

boutell commented Sep 25, 2015

I'm honestly not sure! This bundle has been looking for a new maintainer
for a long time (:

On Fri, Sep 25, 2015 at 3:06 AM, rortegar [email protected] wrote:

Hello! thank you for your answer, I am not really sure about the logic
inside, but In my case it should not create it two times, do you know if
there is some parameter or something that I can set to avoid this?
About the other problem do you know how can I override the extensions that
are going to be used to create the images (ps_file_extensions)?
Than you very much for your help!


Reply to this email directly or view it on GitHub
#78 (comment)
.

*THOMAS BOUTELL, *DEV & OPS
P'UNK AVENUE | (215) 755-1330 | punkave.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants