salles Posted November 16, 2014 Share Posted November 16, 2014 Hi adrian, does the module work if adding images via FTP? Link to comment Share on other sites More sharing options...
Ivan Gretsky Posted November 17, 2014 Share Posted November 17, 2014 Is it possible to make a name mask with numbers? Something like img-{$page->path}-###? And make it start with 001? Link to comment Share on other sites More sharing options...
adrian Posted November 17, 2014 Author Share Posted November 17, 2014 @salles - unfortunately not, but I am curious how you are managing your image uploads with FTP - they won't be attached to a PW page, and so won't be accessible via the API. Please let us know your workflow - maybe there is something we can do to help. Ivan - I think it should currently work almost like that by just using img-{$page->path} - if there is more than one image uploaded, it should start appending -1 etc, the same as PW does natively. Is it critical for you to a predefined number of characters in the number suffix like in your example? If so, let me know - it shouldn't be a hard thing to implement. Link to comment Share on other sites More sharing options...
Ivan Gretsky Posted November 17, 2014 Share Posted November 17, 2014 I like my images having consistent names. But I probably will live without them. So it is up to you - please consider making this if you will have a little spare time for perfection )) Thank you for your module anyway. It should be on someone's list here. 1 Link to comment Share on other sites More sharing options...
salles Posted November 18, 2014 Share Posted November 18, 2014 @salles - unfortunately not, but I am curious how you are managing your image uploads with FTP - they won't be attached to a PW page, and so won't be accessible via the API. Please let us know your workflow - maybe there is something we can do to help. Ah, nevermind. Didn't realize this Just a note: I see the module supports capital letters in random strings but for some reason it only generates numbers and small letters...? Link to comment Share on other sites More sharing options...
adrian Posted November 18, 2014 Author Share Posted November 18, 2014 Ah, nevermind. Didn't realize this Just a note: I see the module supports capital letters in random strings but for some reason it only generates numbers and small letters...? When you say the module supports capital letters in random strings I am assuming you were browsing the generateRandomString function? That was a bit of an oversight on my part. Even though that function generates the string to include capitals, the PW core does not allow capitals in filenames so they are converted automatically to lowercase. I should probably remove the capital letters from the $characters variable, but it really has no impact either way Link to comment Share on other sites More sharing options...
salles Posted November 18, 2014 Share Posted November 18, 2014 When you say the module supports capital letters in random strings I am assuming you were browsing the generateRandomString function? That was a bit of an oversight on my part. Even though that function generates the string to include capitals, the PW core does not allow capitals in filenames so they are converted automatically to lowercase. I should probably remove the capital letters from the $characters variable, but it really has no impact either way Ah, gotcha I wonder if this can be changed in some PW core file?! Link to comment Share on other sites More sharing options...
adrian Posted November 18, 2014 Author Share Posted November 18, 2014 I wonder if this can be changed in some PW core file?! You could hack the core to allow uppercase characters, but obviously this is not a good idea. Here is the function that handles this: https://github.com/ryancramerdesign/ProcessWire/blob/a8024bb49785370aa2e3867bd683094663cfeabf/wire/core/Pagefiles.php#L258 A little reading on this issue: https://processwire.com/talk/topic/7730-why-no-uppercase-or-special-characters-in-the-attached-files/ Link to comment Share on other sites More sharing options...
adrian Posted November 18, 2014 Author Share Posted November 18, 2014 I like my images having consistent names. But I probably will live without them. So it is up to you - please consider making this if you will have a little spare time for perfection )) Thank you for your module anyway. It should be on someone's list here. Ivan - take a look at the latest version for me - let me know if that works how you expect. It should work exactly as you requested. 1 Link to comment Share on other sites More sharing options...
Ivan Gretsky Posted November 20, 2014 Share Posted November 20, 2014 Dear Adrian! I just updated the module and finally, for the first time in 2 years was able to just through the pictures in there instead of manally renaming and moving them to the right folder. It was such a pleasure! You + PW just gifted me a moment of true happiness. I was delighted to show this to my companion working on Joomla! And equally proud of the community to say that this was just done in few days especially for my case. Can't find any dancing emoticon so putting this one . My last challenge is to make them resize on upload. 3 Link to comment Share on other sites More sharing options...
adrian Posted November 20, 2014 Author Share Posted November 20, 2014 Ivan - thanks for the feedback - glad it has made you so happy Without getting too far down the road on the resize on upload topic in this thread, does the "Max Image Dimensions" setting on the Input tab do what you need? The description explains it as: "Optionally enter the max width and/or height of uploaded images. If specified, images will be resized at upload time when they exceed either the max width or height. The resize is performed at upload time, and thus does not affect any images in the system, or images added via the API." If you need some different behavior that you don't think already exists, perhaps you could post something in the Wishlist board. 1 Link to comment Share on other sites More sharing options...
Ivan Gretsky Posted November 20, 2014 Share Posted November 20, 2014 Oh silly me) I've adjusted those settings a few times, but always thought they control maximum and minimum dimensions allowed. My only excuse is that "my can read not big white brotha letters much good" . Probably by setting minimum and maximum to the same value I can achieve the exact size needed (not that it is needed too much since we scale images via API anyway). It would be cool to be able to define width:height ratio (like 4:3) though. And/or behaviour to scale images to that ratio defining scaling options like in imagefiled $options. But all probably exeeds the scope of this topic. Thank you again, Adrian. I'll play with the newly discovered options and with your splendid module. Link to comment Share on other sites More sharing options...
Ivan Gretsky Posted December 7, 2014 Share Posted December 7, 2014 Good day, Adrian! I believe I found a bug in the module. Once again it is probably encoding related (you're becoming true authority on that, like it or not ). If "Rename on Save" option is checked and you have some images in RTE field, non-latin characters get screwed up on save. Like this: Most likely none-RTE fields and RTE fields without images are not affected. Link to comment Share on other sites More sharing options...
adrian Posted December 7, 2014 Author Share Posted December 7, 2014 Hey Ivan - if I am becoming an expert on character encoding, then we should all be very scared - I still have no clue But anyway, I have committed a fix which seems to work fine now in some limited tests. Can you please take a look and let me know. 2 Link to comment Share on other sites More sharing options...
Ivan Gretsky Posted December 7, 2014 Share Posted December 7, 2014 The problem seems to be solved. As I did not localize it accurately enough in the first place, I cannot be 100% sure, but it seem to work alright now. Thank you, Adrian. Will report back if something goes wrong. 1 Link to comment Share on other sites More sharing options...
maba Posted January 8, 2015 Share Posted January 8, 2015 Hi, there is a problem with lastest pw dev. After the update I cannot see my rules in the settings page. Save operation works (overwrite all). Tested with 0.4.2 and 0.4.3. 1 Link to comment Share on other sites More sharing options...
adrian Posted January 8, 2015 Author Share Posted January 8, 2015 This is affecting certain other modules too - https://processwire.com/talk/topic/7588-admin-custom-files/?p=84276 I'll see if I can find some time later to figure out what changed and see about fixing things, either at the module side, or a core fix from Ryan. 1 Link to comment Share on other sites More sharing options...
Ivan Gretsky Posted January 16, 2015 Share Posted January 16, 2015 Please do, Adrian. I can't imagine living without your module anymore ) Link to comment Share on other sites More sharing options...
adrian Posted January 16, 2015 Author Share Posted January 16, 2015 Please do, Adrian. I can't imagine living without your module anymore ) It's all fixed in the latest PW dev version. Martijn worked out one fix, but I think in the end Ryan solved the problem in a different way: https://github.com/ryancramerdesign/ProcessWire/commit/5575ef62bb1695d98162bc3278b8d39bb66433b2#diff-995c5c9ce48d4bff459f52363c6e190eR401 1 Link to comment Share on other sites More sharing options...
Martijn Geerts Posted January 16, 2015 Share Posted January 16, 2015 (edited) @Ivan Gretsky, that one is already fixed (dev). So those settings will work fine again I guess. Edited January 16, 2015 by Martijn Geerts Adrian is quicker 1 Link to comment Share on other sites More sharing options...
Ivan Gretsky Posted January 17, 2015 Share Posted January 17, 2015 I am using 2.5.14. And have no idea if it is the latest and greatest or not. Could you please suggest a way to keep track of dev branch updates. Sorry for offtopic here. I am blindly going through the files on github dev branch and cannot even find those numbers there yet))) Link to comment Share on other sites More sharing options...
Martijn Geerts Posted January 17, 2015 Share Posted January 17, 2015 @Ivan: https://github.com/ryancramerdesign/ProcessWire/blob/dev/wire/core/ProcessWire.php#L36 2 Link to comment Share on other sites More sharing options...
adrian Posted January 17, 2015 Author Share Posted January 17, 2015 I am using 2.5.14. And have no idea if it is the latest and greatest or not. Could you please suggest a way to keep track of dev branch updates. Sorry for offtopic here. I am blindly going through the files on github dev branch and cannot even find those numbers there yet))) Ryan doesn't increase the point version number with every commit, so your best option is to subscribe to the dev RSS feed: https://github.com/ryancramerdesign/ProcessWire/commits/dev.atom 3 Link to comment Share on other sites More sharing options...
Ivan Gretsky Posted March 5, 2015 Share Posted March 5, 2015 Hi, Adrian! I am configuring you wonderful module again. I want my uploads to be named something like passport-{$page->title} But the title field is cyrillic as you could guess)) And it does not transliterate well. Could you fix it so it transliterates like in your Page Rename Options? Link to comment Share on other sites More sharing options...
adrian Posted March 5, 2015 Author Share Posted March 5, 2015 Hey Ivan, I just committed a fix, although in a hurry, so not tested, so please let me know if it works for you as expected. Actually curious why you are using $page->title rather than $page->name - wouldn't it end up being the same thing? 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now