Search code examples
phpimagejoomlamd5joomla-k2

Change image renaming in Joomla K2


I want to change K2's renaming item images with md5. K2's response is "we won't just deal with it or use an extra field for image I wanted to change the code based on the answer I found here but I can't find that code in the current K2. I even tried changing the md5 of each image using imristo's hash manager and a hex to text conversion website so that the file saved in /media/k2/items/cache/ would be something like item_100_image_aaaaaaa.jpg but couldn't make it work

I want the filenames of my images in /media/k2/items/ to stay the same. Why, no reason really, I just like things clean. I don't want to use their suggestion of creating using extra fields and creating an extra field for original, extra small, small, medium, large and extra large because this increases the size of my database. The main reason I'm trying k2 is because my current software sobipro inflates the database when it is indexed. I currently have over 1200 items.

how do I change the current k2 version 2.7.0 to keep the original filenames in /media/k2/items/cache/ I have no spaces in my image filenames. I do have letters, numbers and hyphens but can replace or remove the hyphens. I have only jpg and png images


Solution

  • The problem with that is that you will need to modify K2's core heavily to accommodate your needs - and I'm sure that this is not what you want.

    I understand your needs, but sadly, this can't be done with K2 without substantial modifications to many files (including the core K2 upload file and the view files).

    You can always upload your images via the media manager and just reference them in your K2 articles. I think this would be a clean solution to do that.