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

Feature request: Any plans for WebP support? #13

Closed
EzequielBruni opened this issue Apr 13, 2022 · 3 comments
Closed

Feature request: Any plans for WebP support? #13

EzequielBruni opened this issue Apr 13, 2022 · 3 comments
Assignees
Labels
Enhancement New feature or request

Comments

@EzequielBruni
Copy link

Basically just that. Though I wouldn't say no to the ability to automatically store specific kinds of converted files on the drive automatically. (I work with video a lot.)

@zelon88
Copy link
Owner

zelon88 commented Apr 13, 2022

Thanks for taking the time to submit a feature request.

The ability to convert files to and from .webp files is included in v2.7.1 (9f0c9ba). Other newly supported file formats include;

  1. CRW
  2. CIN
  3. DCR
  4. DDS
  5. DIB
  6. FLIF
  7. GPLT
  8. NEF
  9. ORF
  10. ORA
  11. SCT
  12. SFW
  13. XCF
  14. XWD
  15. AVIF
  16. ICO

As for your request to be able to store converted files on the server, this is a good concept and one that I had actually developed a solution for before HRConvert2 was around. Take a look at HRCloud2. It contains the same conversion engine as HRConvert2 but it also adds user based Cloud drive features as well. It does take a bit more to setup, so keep an eye on HRCloud3 which is probably about a year or so away from a beta version.

@zelon88 zelon88 closed this as completed Apr 13, 2022
@zelon88
Copy link
Owner

zelon88 commented Apr 13, 2022

AI was thinking about your secondary request a little bit more. This can be accomplished by adding two functional lines of code to the convertCore.php file. Specifically, we would need to add the same line of code twice, as there are two cleanup routines. Depending on where you want your permanent copies stored you could get away with only adding one line of code. The line of code is;

if (!is_dir($DFilePath)) if (in_array(pathinfo($DFilePath, PATHINFO_EXTENSION), $VideoArray)) continue;

If you want to store your permanent copies in /var/www/html/HRProprietary/HRConvert2/DATA then add this special line of code directly underneath the line $DFilePath = $ConvertTemp.DIRECTORY_SEPARATOR.$DFile;

If you want to store your permanent copies in the $ConvertLoc specified in config.php then add this special line of code directly underneath the line $DFilePath = $ConvertLoc.DIRECTORY_SEPARATOR.$DFile;

If you want to store permanent copies in both places, then place the special line of code in both places.

Note that this code is specific to Video files, as you said you would like to store those. If we were going to save documents, we would want to specify the $DocumentArray instead. Scroll up a bit in convertCore.php to see which arrays are defined and what extensions they contain.

If you wanted to move these files somewhere else instead of leaving them in either directory we could do something like;

if (!is_dir($DFilePath)) if (in_array(pathinfo($DFilePath, PATHINFO_EXTENSION), $VideoArray)) if (!file_exists($CustomLocation.DIRECTORY_SEPARATOR.$DFile)) copy($DFilePath, $CustomLocation.DIRECTORY_SEPARATOR.$DFile);

Note that you would only need to add this special line of code once. Then add a line in config.php to define $CustomLocation.

// / Custom location for storing permanent files.
// / DO NOT include a trailing slash.
$CustomLocation = '/path/to/your/custom/location';

Just make sure that $CustomLocation exists and that the www-data user has read/write permissions in it.

Note that in all of these special lines of code we've developed we're doing a couple of things. We are checking if the file HRConvert2 is working on is a directory, because if it is then PATHINFO_EXTENSION would throw an error. In the later code samples we're also checking that a file does not already exist in the $CustomLocation. If it did and we tried to write another one then copy would throw an error.

@zelon88 zelon88 added the Enhancement New feature or request label Apr 13, 2022
@zelon88 zelon88 self-assigned this Apr 13, 2022
@EzequielBruni
Copy link
Author

@zelon88 Thanks for all the responses and help! Good to know WebP is already working. I don't need a full cloud platform at present, but in my home office I have two PCs, right? One where I do my work and gaming, and one that acts as a server/records video and audio from my first PC.

So I'm thinking that I could install the converter on my server-ish PC, and just have it automatically store files I convert. And well, with everything you just wrote, I think that might well be possible. Could probably even make it work in a (privileged) LXD container and mount the relevant data directories as storage in the container...

A project to consider. (He said, adding it to an ever-growing and increasingly impractical list.)

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

No branches or pull requests

2 participants