Jump to content

Media Manager Archive


kongondo

Recommended Posts

On 1/28/2019 at 10:18 PM, kongondo said:

@besrwordt,

Do you have a current Media Manager subscription? makeBlankItem() is implemented in the latest Media Manager (version 012, soon coming out of beta). However, you can still import from one MM field to another. A MM field behaves like PageArrays (WireArrays).  

Yes i have. Will try that for sure!

A Media Manager field stores only two pieces of data; the (page) ID of the media being referenced and the media type (1=audio; 2=document; 3=image; 4=video; 3x=image variation). There's two ways you can go about exporting/importing from one field to the other. The second way is easiest if you need to import everything from one field to another, no questions asked. The first method allows fine control, e.g. if you want to skip certain media types. In the examples below, media_export is the Media Manager field with the media you want to copy over/merge with a second Media Manager field. media_import is the second Media Manager field into which media is being imported/copied over.

Method One: Loop through each media in the Media Manager field you are exporting from


// page with mm field we are importing into (media_import)
$p = $pages->get(1234);

// page with mm field we are exporting from (media_export)
foreach ($page->media_export as $m ) {
    // @note: here you can skip media you don't want to export
    // instance of new MediaManager()
    $mm = new MediaManager();
    // populate the MediaManager object properties with required data (media id and type)
    $mm->id = $m->id;
    $mm->type = $m->type;
    // import/add the media to the 2nd mm field (media_import)
    $p->media_import->add($mm);
}

// output formatting of
$p->of(false);
// save only the media manager field (page with import mm field)
$p->save('media_import');
// revert output formatting back on
$p->of(true);

 

Method Two: Import everything at once


// page with mm field we are importing into (media_import)
$p = $pages->get(1234);
// import all the media in the 1st mm field (media_export) into the 2nd mm field (media_import)
$p->media_import->import($page->media_export);
// output formatting of
$p->of(false);
// save only the media manager field (page with import mm field)
$p->save('media_import');
// revert output formatting back on
$p->of(true);

 

Note that all WireArray behaviour apply. For instance, you might want to first experiment in cases where your 2nd Media Manager field (media_import) already has some media which may or may not be present in the first Media Manager field. 

Great, Thanks!!!

 

Link to comment
Share on other sites

We've been experimenting with the v12 beta and have mostly had success with the new version.  We recently ran into a problem where the upload stopped working.  We can still upload via ftp and the "scan" function.  This is error that Tracy reports immediately after the files are uploaded.  We tried refreshing the module, but no go. 

MM-v12-error.png

Link to comment
Share on other sites

12 hours ago, Karinne Cyphers said:

We recently ran into a problem where the upload stopped working.  We can still upload via ftp and the "scan" function.  This is error that Tracy reports immediately after the files are uploaded.  We tried refreshing the module, but no go. 

Thanks for testing. The error says means that the media has not been found. It means that the media field is empty, for some reason, which is strange. The line where the error occurs tells me that in your settings you specify that uploading a duplicate media should replace the one that already exists in the Media Manager Library. Using these settings, I have tried to replicate the error that you are getting but everything works fine. The old media is replaced fine. Could you please provide more details? 

  1. What sort of media are you getting the error with? E.g. images
  2. If images, are they huge images?
  3. ProcessWire + PHP Versions
  4. What upload mode are you using? I've tried with both 'upload anywhere' on and off and I get no errors.
  5. It could be that you had an unfinished upload (maybe PHP ran out of memory). Could this be the case?

I have modified the file where the error is occurring to at least suppress the error. I've emailed it to you.

Link to comment
Share on other sites

Yes, what is strange is that the upload functionality was working fine, then it stopped working and began throwing those two errors.  Here are the details:

  1. Some media is a couple of megapixels, but the majority are things like icons and small graphics that are under 100kb, mostly imagees
  2. Most of the images are under 1mb and most are under 100kb
  3. Processwire 3.0.123 and PHP 7.3.x running as FPM
  4. We have upload anywhere turned on, but most of the uploads are done via the Media Manager itself
  5. The servers are virtualized but we have 256mb dedicated to PHP

We'll try to use the file you sent to see if suppressing helps the error.

Link to comment
Share on other sites

10 hours ago, Karinne Cyphers said:

Yes, what is strange is that the upload functionality was working fine, then it stopped working and began throwing those two errors. 

My bet is that there's an upload that didn't get completed and/or a media that, for some reason, did not get deleted and the process is stuck in memory.  Is it possible to try the following for me please?

  1. If you change the setting for "replacing duplicate media", to either "skip" or "rename" the uploaded media, does normal uploading work?
  2. With the setting back to "replace duplicate media", are you able to narrow down what particular image(s) leads to the errors? For instance, the error always occurs when you try to "upload and replace" a media called "Cats". We can then visit the "Cats" media page to edit it and see if there are any errors there.
  3. Are you able to edit your media pages to confirm that they all have images (i.e. they are not empty)?
  4. Are the images JPGs or PNGs or both?
Link to comment
Share on other sites

Well, it's strange... we toggled the replace duplicate media and gave it a go and now it is working again.  I set it back to confirm overwrite and it is still working.  This may be related to some other server issues we've been having, but our server guy has been making some adjustments to the environments today as well so that may have also had an impact.  Thank for your help with this!

Link to comment
Share on other sites

9 hours ago, Karinne Cyphers said:

Thank for your help with this!

Glad you got it sorted :-).

 

9 hours ago, Karinne Cyphers said:

One other quick question, is there a configurable option to change the number of items returned?  I think by default it is set to 30, but is there an easy place we can change that?  Our content team has started to give us feedback and this was at the top of their list.

Yes. You can change the limit and lots of other similar stuff by using the filters under "What media to show". You can also configure and save a filter to be used as the default. Results can be filtered by a single or multiple criteria such as limit, title, description, tags, published, modified, etc. You can use operators such as contains text, equals, etc. The results are automatically refreshed when a filter is applied. Please see the two examples below. The first involves filtering the results directly without creating and saving the filter, although the filter will be cached and applied until the cache expires. The second one shows you how to create and save a filter that you can subsequently set as your default filter. This is especially useful if you are working in teams that need results tailored to their workflow. Please note that you may at times need to reset (rather than refresh) filters for a new one to apply due to caching. Although you can clear this type of filter directly, subsequent reloads with reload the filter as well. Hence, this type of filter persists across sessions. In the "What media to show" panel, the reset icon is the second one after the filters tab. The first icon is for refresh.

Direct Filter

 

media-manager-limit.thumb.gif.0ebf863d0f28b4a60f1a0ae5c6d7bb44.gif

 

Configure, Save and Apply Filter

In this example, we classify a number of items using a common tag, 'people'. We then create a filter titled People which limits the results returned by number (2) and tag (people). Please note that you do not have to use tags if all you are interested in is limit. We only use it to enrich the example. Finally, we set People as the default filter.  As a by  the way, you can also use tags to filter items in the frontend using a ProcessWire selector ?

media-manager-limit-filter.thumb.gif.aa2921d3ce8f713c151e30c3ce49c4a2.gif

  • Like 1
Link to comment
Share on other sites

Hi @kongondo,

we've discovered a strange behaviour of Media Manager upload (v 011): If the file extension is uppercase, i.e. "JPG", then the upload fails, despite "jpg" is set as valid image extension in settings. We've tried to add "JPG" (in uppercase) to the valid image extensions, but with no luck. The solution was finally to bulk rename all the files to lowercase jpg extension on a local device.

Have you ever heart of this beaviour? From my programmers view, I would assume, that the file extension check is case insensitive, but it isn't?

Greetings,

Thomas.

Link to comment
Share on other sites

HI @xportde

 

24 minutes ago, xportde said:

we've discovered a strange behaviour of Media Manager upload (v 011): If the file extension is uppercase, i.e. "JPG", then the upload fails, despite "jpg" is set as valid image extension in settings. We've tried to add "JPG" (in uppercase) to the valid image extensions, but with no luck. The solution was finally to bulk rename all the files to lowercase jpg extension on a local device.

Have you ever heart of this beaviour?

I'm not sure what's going on in your install :-). I've never experienced this behaviour before nor have I ever received a report about it. Just to be double sure, I've just now tested (MM 011; JFU 006) with an image with a .JPG extension and it is uploaded just fine. Any error shown? 

Link to comment
Share on other sites

4 minutes ago, xportde said:

So, if you never heart of this before, and it not seems to be a general problem, we will ask our customer not to use uppercased file extensions.

What's their server environment? Are they on Windows? 

Edited by kongondo
Link to comment
Share on other sites

  • 2 months later...

Hi @kongondo,

we've tested your new MM 012, great work!

In grid view, there is a small bug in rendering thumbnails: If the calculated width is not a whole number, the style of the elements div.mm_page_thumb is written as "width: 263,5px" for example. Because browsers expect decimal numbers in CSS with a dot, they fail in case of the comma, so the width is undefined and the thumbnail is not shown (see screenshot).

This error probably only occurs in german environments, where the decimal point is the comma by default.

I've changed line 524 in MediaManagerRenderer.php, what fixed the problem:

$wrapperWidth =  str_replace(',', '.', $media->thumbWidth) . 'px';

Alternatively, rounding the thumb width will have the same effect, because the decimal part isn't really important on rendering.

Greetings,

Thomas.

Screenshot MM 012 Grid View.jpg

  • Like 2
Link to comment
Share on other sites

On 5/8/2019 at 2:38 PM, xportde said:

In grid view, there is a small bug in rendering thumbnails: If the calculated width is not a whole number, the style of the elements div.mm_page_thumb is written as "width: 263,5px" for example. Because browsers expect decimal numbers in CSS with a dot, they fail in case of the comma, so the width is undefined and the thumbnail is not shown (see screenshot).

This error probably only occurs in german environments, where the decimal point is the comma by default.

Excellent find! You've saved me some debugging headache, thanks :-). A user reported missing images in grid view (table view was fine) and I couldn't figure out what was going on (I didn't have access to that site) but it was also a German user :-). 

Fixed in the release version (012). Please see post below.

Edited by kongondo
Link to comment
Share on other sites

Media Manager version 012  (released 10/05/2019)

Happy to announce the latest release of Media Manager.

Changelog

  1. ProcessWire 3.x support only.
  2. New GUI to match AdminThemeUiKit
  3. Upload Anywhere (drag and drop to upload in Media Manager Library and Media Manager Inputfields).
  4. Custom fields/columns - add any field to any of the Media Manager templates and access them as a property of a MediaManager object.
  5. Edit a single media including its custom fields

I would like to thank all the beta testers!

Documentation

Documentation is now complete! Please report any missing links or anything that is not clear.

Upgrading

  1. Grab the latest version of JqueryFileUpload (version 008) from here. Upgrade to that version (note: it is also namespaced)
  2. Grab the latest version of Media Manager using resend download links form here. Simply overwrite existing files but delete the files MediaManagerTabs.php and pocketgrid.css in the old files. Hit module refresh.

You might need to clear compiled files several times.

For most beta testers, upgrading has gone smoothly. However, two people have reported an error about class ProcessMediaManager not found in line 20 of MediaManagerUtilities. I have not been able to resolve this issue. I suspect FileCompiler is trying to be clever or some module loading order change?

Please let me know how it goes.

Beta testers, please upgrade as well. A few things have changed including a fix for the bug reported in the previous post.

Screenshots

media-manager.thumb.jpg.5b8aa9d4cc13f0638f5eb2d1c9f74f5c.jpg

Please refer to the documentation for more photos.

Thanks!

  • Like 3
  • Thanks 1
Link to comment
Share on other sites

  • 2 weeks later...

Hi @kongondo,

For one of our customers, some pages of the MediaManager image view are not shown, because they contain some too big original images. Referring to this, in error protocol is written the well-known "Allowed memory size of .. bytes exhausted"-message, but we can't find out, what specific image is causing this.

Have you any idea to identify the problematic images?

Best regards,

Thomas.

Link to comment
Share on other sites

23 hours ago, xportde said:

For one of our customers, some pages of the MediaManager image view are not shown, because they contain some too big original images. Referring to this, in error protocol is written the well-known "Allowed memory size of .. bytes exhausted"-message, but we can't find out, what specific image is causing this.

Oh, oh. Someone forgot to set limits to upload sizes and/or client-side image resizing ??.

23 hours ago, xportde said:

Have you any idea to identify the problematic images?

Good question. I'm not sure whether the code below will work. I don't know whether such images are counted by ProcessWire as uploaded or it is just their resizing that is an issue. I don't have a test image to use but try the below please in a Tracy console and let me know. It is just checking for empties. If it doesn't work maybe we can search by image size (0x260) instead.

$empties = $pages->find("template=media-manager-image,media_manager_image.count=0");
d($empties,'EMPTIES');

 

Link to comment
Share on other sites

  • 2 weeks later...

I hope you don't mind me giving a little constructive feedback, it's going to be a bit critical but it's just an aspect that I think is being overlooked in an otherwise excellent module.

I think one thing that is holding me back from embracing this media manager (actually, we bought this in the past and then never used it -- and this is because there's no demo available) is that it really needs a little love in the styling department.

Nothing fancy, but -- if we look at the screenshot above we can see just general CSS issues, alignment of the filter label top right, checkbox and sort icons are too close to the sort options, a lot of negative space between the filters and the nav, image count is too big and not aligned with pagination opposite. The spacing also between the types of media along the top is also not right when compared to how the CMS typically spaces out horizontal navigation. This is just in one screenshot, but these issues persist throughout in various places, such as notifications, upload boxes etc.

Considering we have the UIKit CMS theme to base everything off, this kind of thing means that the media manager feels out of place in an otherwise quite neatly organised CMS.

Now, people using this media manager for their personal projects will not care about these things, they will roll their eyes and say "why should we care, it's the back-end of the site, only functionality matters" (and in this, I must reiterate, you have done an outstanding job), however if I am building a CMS and handing it over to someone else, I need all aspects to have a consistency in quality because that is reassuring to clients.

  • Like 2
Link to comment
Share on other sites

24 minutes ago, cjx2240 said:

I hope you don't mind me giving a little constructive feedback

Not at all :-). Thanks for the feedback. I value such feedback.

24 minutes ago, cjx2240 said:

and this is because there's no demo available

Actually there is/was...but it is outdated. I can look into this. Meanwhile, one can always test and request a refund if they are not satisfied with the product :-). 

24 minutes ago, cjx2240 said:

Now, people using this media manager for their personal projects will not care about these things, they will roll their eyes and say "why should we care, it's the back-end of the site, only functionality matters" (and in this, I must reiterate, you have done an outstanding job), however if I am building a CMS and handing it over to someone else, I need all aspects to have a consistency in quality because that is reassuring to clients.

Agreed. The thing that confuses me though is that we have hundreds of people using Media Manager, for client projects, some quite big (working with Hollywood; +500K images, etc) but not a single person has ever mentioned design issues. I am not saying this translates to no issues but a I am a bit curious why no one else has raised such issues.

Thanks.

Link to comment
Share on other sites

39 minutes ago, kongondo said:

Agreed. The thing that confuses me though is that we have hundreds of people using Media Manager, for client projects, some quite big (working with Hollywood; +500K images, etc) but not a single person has ever mentioned design issues. I am not saying this translates to no issues but a I am a bit curious why no one else has raised such issues.

I can only speak for myself. But I feel the same way. I bought the Media Manager, but never used it. Once I used it in a customer project, I had feedback from the customers that the visualization and usability was not good for them. Personally, I'm also a little bothered by that. Why have I never submitted this as a suggestion for improvement? You know: laziness. I always had the hope that others would do it and that there would be an update at some point. ? 

  • Like 2
Link to comment
Share on other sites

7 minutes ago, David Karich said:

Once I used it in a customer project, I had feedback from the customers that the visualization and usability was not good for them.

Thanks for the feedback. Was this an older version or the latest (012)?

Link to comment
Share on other sites

4 minutes ago, kongondo said:

Thanks for the feedback. Was this an older version or the latest (012)?

To be fair, the last version I worked with is 011. Of course there have been some changes with the new version, but optically I see some deficits as well. Apropos: I never received a download link for the update to 012 by mail. Or do I have to buy a new license?

Link to comment
Share on other sites

13 minutes ago, kongondo said:

Thanks for the feedback. Was this an older version or the latest (012)?

I can also tell you what bothered her the most, besides the visual component. My customers like to think in folders. They would like to click through a tree and categorize the data into folders. As PW itself is structured. Because the biggest problem here again is laziness itself. If you upload a picture and don't immediately describe and tag it properly, later searching becomes difficult. And my customers are all hectic and have no time for that. ? 

Link to comment
Share on other sites

1 hour ago, kongondo said:

Agreed. The thing that confuses me though is that we have hundreds of people using Media Manager, for client projects, some quite big (working with Hollywood; +500K images, etc) but not a single person has ever mentioned design issues.

@kongondo Good to know (+500k), do they use $config->pagefileExtendedPaths, an unlimited file system or are there special features of the Media Manager for storing the images?

Link to comment
Share on other sites

  • kongondo changed the title to Media Manager Archive
  • kongondo pinned and locked this topic
Guest
This topic is now closed to further replies.
×
×
  • Create New...