Code Monkey home page Code Monkey logo

Comments (3)

zelon88 avatar zelon88 commented on May 20, 2024

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.

from hrconvert2.

zelon88 avatar zelon88 commented on May 20, 2024

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.

from hrconvert2.

EzequielBruni avatar EzequielBruni commented on May 20, 2024

@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.)

from hrconvert2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.