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

Images are not being created in different versions #808

Closed
sebastiandl opened this issue May 9, 2018 · 6 comments
Closed

Images are not being created in different versions #808

sebastiandl opened this issue May 9, 2018 · 6 comments

Comments

@sebastiandl
Copy link

Hello! I was just wondering if there is a way to configure this tool to upload an image in different sizes apart from the original one. For example, if I upload "example.jpg", I want to also have multiple images created with size 100x75 and 240x180 apart from the original one. After investigating a little bit I have found that I can accomplish this by using the hook before_upload and setting the params versions. At the moment I have something like this:

system.json:

  "helpers": ["ApplicationHelper"],
  "hooks": {
    "before_upload": ["set_size_for_images"]
  }

application_helper.rb:

  def set_size_for_images(settings)
    settings[:versions] = '100x75,240x180'
  end

However, having this configuration does not works. Camaleon only uploads the image in the original size. I am currently trying to find out the reason behind this by I was not lucky so far.

Anyway, is this something that you already have under the radar? or is this issue completely new? I was not able to find any other issue open related to this.

@sebastiandl
Copy link
Author

Important: I am currently using camaleon_cms (2.4.5.5)

@brian-kephart
Copy link
Collaborator

I've never used hooks in the global config/system.json. I've always placed that code in app/apps/themes/some_theme/config/config.json. I'm not sure if that's supposed to matter, but please give it a try and report back.

If that doesn't work, a few other questions:

  1. Are you using the local uploader, or AWS?
  2. Did you look in the filesystem for the resized images, or just look in the media uploader? This would help us figure out if there's a bug in the uploader, or a bug in the media browser.
  3. Did you try selecting "Reload" or "Clear Cache" in the media browser?
  4. What versions of Ruby & Rails are you using?

@owen2345
Copy link
Owner

Hi @sebastianGitDL
please review the thumb directory, version files are located together with thumb file.
Cheers!

@sebastiandl
Copy link
Author

Hello! Sorry for the delay!

I have been performing several tests related to this issue and was able to confirm what you mentioned @owen2345 about those versions being saved in the thumb directory! (if only I would have read your answer before)

Anyway, what I am trying to pursue is giving the possibility to the user to upload images in any size (always in 4:3 ratio size), and configuring Camaleon to create multiple versions of that image in some fixed sizes (for example: 100x75 and 500x413). And in the end allowing the user to insert the original image (or any of those versions) inside a Post/Page.

I wanted to share this with you since it might be a nice improvement in the long run. I will try solving this issue on my side with a workaround, but eventually will see if I can code a nice fix and share it with you.

Thanks again for the answer!

@owen2345
Copy link
Owner

Great!
You can use these hooks:

@sebastiandl
Copy link
Author

Thank you! I will close the issue as well.

Have a good one!

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

3 participants