Mirror Images

Mirror Images [Paid] 1.5.0

No permission to buy ($25.00)
Is this a bug with this add-on?

PHP:
Server error log
LogicException: Cannot save with validation errors. Use validate() to ensure there are no errors. (First error: Your post only contains smilies and no message. Your post cannot be submitted. ) src/XF/Service/ValidateAndSavableTrait.php:36

Generated by: Admin Sep 18, 2025 at 1:03 AM

Stack trace
#0 src/addons/NF/MirrorImages/Job/MirrorImages.php(36): XF\Service\Post\EditorService->save()
#1 src/XF/Job/AbstractRebuildJob.php(42): NF\MirrorImages\Job\MirrorImages->rebuildById(111842)
#2 src/XF/Job/Manager.php(275): XF\Job\AbstractRebuildJob->run(29.8825)
#3 src/XF/Job/Manager.php(205): XF\Job\Manager->runJobInternal(Array, 29.8825)
#4 src/XF/Job/Manager.php(89): XF\Job\Manager->runJobEntry(Array, 29.8825)
#5 src/XF/Admin/Controller/ToolsController.php(165): XF\Job\Manager->runQueue(true, 30)
#6 src/XF/Mvc/Dispatcher.php(362): XF\Admin\Controller\ToolsController->actionRunJob(Object(XF\Mvc\ParameterBag))
#7 src/XF/Mvc/Dispatcher.php(264): XF\Mvc\Dispatcher->dispatchClass('XF:Tools', 'RunJob', Object(XF\Mvc\RouteMatch), Object(Hampel\ApprovalQueuePlus\XF\Admin\Controller\Tools), NULL)
#8 src/XF/Mvc/Dispatcher.php(121): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(Hampel\ApprovalQueuePlus\XF\Admin\Controller\Tools), NULL)
#9 src/XF/Mvc/Dispatcher.php(63): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#10 src/XF/App.php(2824): XF\Mvc\Dispatcher->run()
#11 src/XF.php(806): XF\App->run()
#12 admin.php(15): XF::runApp('XF\\Admin\\App')
#13 {main}

Request state
array(4) {
  ["url"] => string(24) "/admin.php?tools/run-job"
  ["referrer"] => string(44) "https://xenforo.com/admin.php?tools/run-job"
  ["_GET"] => array(1) {
    ["tools/run-job"] => string(0) ""
  }
  ["_POST"] => array(3) {
    ["_xfRedirect"] => string(30) "https://xenforo.com/admin.php"
    ["_xfToken"] => string(8) "********"
    ["only_ids"] => string(0) ""
  }
}
Yep, it was. Fixed in 1.4.4, thanks!
 
  • Love
Reactions: rdn
Naz updated Mirror Images with a new update entry:

Version 1.5.0

  • Require Standard Library by Xon v1.22.0+.
  • Add start option to CLI command to support mirroring after a specific post ID and onwards.
  • Fix issue where XF 2.2 would attempt to mirror images when previewing content.
  • Fix issue where BB code options (e.g. size/alt/etc) would be dropped when replaced with a [attach] BB code.
    [/LIST]

Read the rest of this update entry...
 
What CLI command do I use to scan all content for linked images?

Is there supposed to be a cron for this?

Please add support for AMS, UBS, RMS, XFRM. (AMS first please)
 
Last edited:
OMG, I so want this.

Does this add-on work with all hosting sites, Smugmug and flickr being the most important ones? I ask because I tried another conversion add-on that had a problem with flickr embeds, sometimes converting images, sometimes not, so I had to uninstall it.

Also, does this one remove the flickr link below the images? The add-on I mentioned didn't remove that link and as we have the EXIF below the images on the board, it looked kinda messy:

Converted embed with flickr link below img .webp
 
What CLI command do I use to scan all content for linked images?
You can use php cmd.php xf-rebuild:nf-mirror-images --start=X where X is the post ID you want to start from. Note, this only covers posts. I need to expand this to cover other content types.
Is there supposed to be a cron for this?
No, the mirroring happens once the content is submitted.
 
OMG, I so want this.

Does this add-on work with all hosting sites, Smugmug and flickr being the most important ones? I ask because I tried another conversion add-on that had a problem with flickr embeds, sometimes converting images, sometimes not, so I had to uninstall it.

Also, does this one remove the flickr link below the images? The add-on I mentioned didn't remove that link and as we have the EXIF below the images on the board, it looked kinda messy:

View attachment 328319
Yeah, should work as long as the image can be fetched by XF. I'm not sure where the Flickr link is coming from in your example but you can try the add-on on the demo site to see if it meets your requirements: https://demos.nixfifty.com/

Worth mentioning that currently EXIF data isn't brought over so that might be something to consider.
 
Yeah, should work as long as the image can be fetched by XF. I'm not sure where the Flickr link is coming from in your example but you can try the add-on on the demo site to see if it meets your requirements: https://demos.nixfifty.com/
I've looked on your demo site and registered but not sure where I can test the add-on? I thought maybe it's active so I tried embedding an image from flickr in a test thread in "Demo threads" but it wasn't converted.

Worth mentioning that currently EXIF data isn't brought over so that might be something to consider.
I have an add-on to display the EXIF below the image. But yes, it needs to be embedded in the file of course. From what I know from flickr is that it only includes the EXIF if you embed the "original size" (which is the size you uploaded to flickr, so it can be anything). Any other size and the metadata is stripped.
 
I've looked on your demo site and registered but not sure where I can test the add-on? I thought maybe it's active so I tried embedding an image from flickr in a test thread in "Demo threads" but it wasn't converted.
Maybe there's some confusion on how / what this add-on does. I see your test posts and can see that the hotlinked image from Flickr was replaced by an XF attachment version of the same image (you can confirm this by editing your post and viewing the BB code). Are you expecting something else when you say that it wasn't converted?

Also, does this one remove the flickr link below the images?
I just noticed I missed this question but no, if the image is embedded with text around it, that'll be preserved as it stands.

I have an add-on to display the EXIF below the image. But yes, it needs to be embedded in the file of course. From what I know from flickr is that it only includes the EXIF if you embed the "original size" (which is the size you uploaded to flickr, so it can be anything). Any other size and the metadata is stripped.
Yeah, that's something I need to look in to at some point.
 
Maybe there's some confusion on how / what this add-on does. I see your test posts and can see that the hotlinked image from Flickr was replaced by an XF attachment version of the same image (you can confirm this by editing your post and viewing the BB code). Are you expecting something else when you say that it wasn't converted?
So what I expected was that the images I linked to from flickr would be converted from an embed into an attachment automatically and that the link to flickr would be severed! The latter didn't happen so I thought it didn't work. I never actually looked at the BBCode.

The image where the hotlink was replaced by an XF attachment was my doing as I manually removed the URL bits so only the bit between the IMG tags remained, making it an attachment whereby the link to flickr was severed. Again, didn't look at the actual code. Stupid. I deleted those posts so I have no access to them any more.

However, after reading your reply, I went back to your demo site just now and embedded another pic from flickr and this time actually looked at the BBCode and I see what you did there. And I think this is an even better solution as now people can still click on an image and check out a member's other work whilst the images on the board are protected. That is, I am right that should anything change with an image on flickr (moved there or deleted or permissions changed etc), the image on the board will be unaffected? Because that is my main reason for wanting this. I have very little faith in photo hosting sites and don't want a repeat of the Photobucket disaster that broke half the internet 8 years ago!
 
  • Like
Reactions: Naz
I have just ran the script through 2 million posts. Is there a way to see the results? i.e. check which posts got attachments successfully added and see if it all looks good?
 
Ah yes, I'm just getting used to XF2 as we recently upgraded. The attachment browser is handy.
I see that 314 image were added today. The posts look pretty nice.
We had a similar script for XF1: Meta-Mirror, which added tens of thousands of images and documents as attachments. Nice to see that this addon already catched 300+ images.
 
So what I expected was that the images I linked to from flickr would be converted from an embed into an attachment automatically and that the link to flickr would be severed! The latter didn't happen so I thought it didn't work. I never actually looked at the BBCode.

The image where the hotlink was replaced by an XF attachment was my doing as I manually removed the URL bits so only the bit between the IMG tags remained, making it an attachment whereby the link to flickr was severed. Again, didn't look at the actual code. Stupid. I deleted those posts so I have no access to them any more.

However, after reading your reply, I went back to your demo site just now and embedded another pic from flickr and this time actually looked at the BBCode and I see what you did there. And I think this is an even better solution as now people can still click on an image and check out a member's other work whilst the images on the board are protected. That is, I am right that should anything change with an image on flickr (moved there or deleted or permissions changed etc), the image on the board will be unaffected? Because that is my main reason for wanting this. I have very little faith in photo hosting sites and don't want a repeat of the Photobucket disaster that broke half the internet 8 years ago!
Exactly. While it's technically possible to remove the URL if a hotlinked image is wrapped in one, I don't think that's ideal as it could alter the original post's intent (e.g. someone wanting users to view their other work).

And yes, that's correct. Since the image is "mirrored" as an XF attachment, there's now a copy on your server. If the original image host goes down, the image will remain intact on your site.
 
Exactly. While it's technically possible to remove the URL if a hotlinked image is wrapped in one, I don't think that's ideal as it could alter the original post's intent (e.g. someone wanting users to view their other work).

And yes, that's correct. Since the image is "mirrored" as an XF attachment, there's now a copy on your server. If the original image host goes down, the image will remain intact on your site.
You've been great, Naz. Thank you. I purchased the add-on.
 
  • Like
Reactions: Naz
Back
Top Bottom