To participate you must create an account on apostrophenow.org. If you have already done so, click Login.

Ticket #109 (assigned defect)

Opened 2 years ago

Last modified 13 months ago

Division by zero

Reported by: cysiaczek Owned by: tboutell
Priority: minor Milestone: 1.5.2
Component: apostrophePlugin Version: 1.4
Keywords: media, pdf Cc: johnnyoffline, hillerj,
Symfony version: 1.4

Description

When I'm trying to add the rss feed URL, i get:

Warning: Division by zero in E:\www\cysiaczek\apostrophe\plugins\apostrophePlugin\lib\toolkit\aDimensions.class.php on line 19

Attachments

F_BRUNCH 5 27 10.pdf Download (303.5 KB) - added by stereoscott 19 months ago.
Sample PDF that has null dimensions... result of incompatible PDF, or server side issues?

Change History

Changed 2 years ago by boutell

  • status changed from new to accepted

So far this works for us. Can you help the process along by providing the feed URL you are having this problem with?

It's a little strange that you are in aDimensions when dealing with a feed, since they don't involve aDimensions at all. Any chance this is actually related to an image or slideshow slot on the page somewhere?

Does the feed slot actually work, or no?

Changed 2 years ago by cysiaczek

I have to appologise. I was testing a lot of functionalities in same time and i wrote a bad slot type :-)

Problem is in PDF's, feed slot works fine

 http://img175.imageshack.us/img175/8794/failvm.png

Changed 2 years ago by boutell

  • milestone changed from 1.0 to 1.0.9

Changed 23 months ago by boutell

  • cc johnnyoffline, hillerj, added
  • status changed from accepted to closed
  • resolution set to fixed

Verified this was fixed as part of the reworked PDF slot John and Jake implemented. We don't display inline previews of PDFs in pages anymore as they tend to be less helpful than an icon and a title, although we do display them in the media repository. I've verified that they are not generating division by zero warnings there (: You'll see this in 1.0.9 if you are not on svn.

Changed 19 months ago by stereoscott

  • priority changed from major to minor
  • status changed from closed to reopened
  • resolution fixed deleted

So I just ran into this notice tonight after I had selected a PDF for a slot. The notice appeared in the slot right above the icon to download the PDF.

I checked the a_media_item table and the width and height columns for the PDF are both null, so when passing $item->width to the aDimensions::constrain() method we get the division by zero error.

Maybe we just put a check in the aDimensions method for empty values and simply return the width specified the $optionswidth? parameter to constrain().

Not a huge priority. Also probably depends on the PDF. The PDF in question was one generated with Acrobat Pro.

Here is the stack trace:

Warning: Division by zero in /project/plugins/apostrophePlugin/lib/toolkit/aDimensions.class.php on line 19 Call Stack: 0.0002 645568 1. {main}() /project/web/frontend_dev.php:0 0.1998 21088952 2. sfContext->dispatch() /project/web/frontend_dev.php:13 0.1998 21089000 3. sfFrontWebController->dispatch() /project/lib/vendor/symfony/lib/util/sfContext.class.php:170 0.2001 21116344 4. sfController->forward() /project/lib/vendor/symfony/lib/controller/sfFrontWebController.class.php:48 0.2095 22094128 5. sfFilterChain->execute() /project/lib/vendor/symfony/lib/controller/sfController.class.php:233 0.2098 22095568 6. sfRenderingFilter->execute() /project/lib/vendor/symfony/lib/filter/sfFilterChain.class.php:53 0.2098 22095568 7. sfFilterChain->execute() /project/lib/vendor/symfony/lib/filter/sfRenderingFilter.class.php:33 0.2099 22097472 8. sfExecutionFilter->execute() /project/lib/vendor/symfony/lib/filter/sfFilterChain.class.php:53 0.6647 38159280 9. sfExecutionFilter->handleView() /project/lib/vendor/symfony/lib/filter/sfExecutionFilter.class.php:47 0.6647 38159280 10. sfExecutionFilter->executeView() /project/lib/vendor/symfony/lib/filter/sfExecutionFilter.class.php:116 0.6672 38362936 11. sfPHPView->render() /project/lib/vendor/symfony/lib/filter/sfExecutionFilter.class.php:155 0.6673 38363320 12. sfPHPView->renderFile() /project/lib/vendor/symfony/lib/view/sfPHPView.class.php:185 0.6721 39049744 13. require('/project/plugins/apostrophePlugin/modules/a/templates/moveSlotSuccess.php') /project/lib/vendor/symfony/lib/view/sfPHPView.class.php:75 0.6743 39333240 14. include_component() /project/plugins/apostrophePlugin/modules/a/templates/moveSlotSuccess.php:3 0.6743 39333240 15. get_component() /project/lib/vendor/symfony/lib/helper/PartialHelper.php:115 0.6803 39617112 16. sfPartialView->render() /project/lib/vendor/symfony/lib/helper/PartialHelper.php:155 0.6803 39618600 17. sfPHPView->renderFile() /project/lib/vendor/symfony/lib/view/sfPartialView.class.php:110 0.6814 39789088 18. require('/project/plugins/apostrophePlugin/modules/a/templates/_area.php') /project/lib/vendor/symfony/lib/view/sfPHPView.class.php:75 0.7421 41606312 19. a_slot_body() /project/plugins/apostrophePlugin/modules/a/templates/_area.php:101 0.7434 41660176 20. include_component() /project/plugins/apostrophePlugin/lib/helper/aHelper.php:98 0.7434 41660176 21. get_component() /project/lib/vendor/symfony/lib/helper/PartialHelper.php:115 0.7464 41675064 22. sfPartialView->render() /project/lib/vendor/symfony/lib/helper/PartialHelper.php:155 0.7464 41675432 23. sfPHPView->renderFile() /project/lib/vendor/symfony/lib/view/sfPartialView.class.php:110 0.7471 41781600 24. require('/project/plugins/apostrophePlugin/modules/a/templates/_slot.php') /project/lib/vendor/symfony/lib/view/sfPHPView.class.php:75 0.7561 41795168 25. include_component() /project/plugins/apostrophePlugin/modules/a/templates/_slot.php:60 0.7561 41795168 26. get_component() /project/lib/vendor/symfony/lib/helper/PartialHelper.php:115 0.7564 41800712 27. _call_component() /project/lib/vendor/symfony/lib/helper/PartialHelper.php:148 0.7580 41806696 28. BaseaPDFSlotComponents->executeNormalView() /project/lib/vendor/symfony/lib/helper/PartialHelper.php:386 0.7601 41836040 29. aDimensions::constrain() /project/plugins/apostrophePlugin/lib/action/BaseaPDFSlotComponents.class.php:40 

Changed 19 months ago by tboutell

  • owner changed from boutell to tboutell
  • status changed from reopened to assigned

Does this happen only with some PDFs?

Sounds like bad handling of cases where we can pull the PDF's dimensions but then unexpectedly can't actually render it.

Changed 19 months ago by tboutell

  • keywords media, pdf added
  • version set to 1.4
  • milestone changed from 1.0.9 to 1.4.1

Changed 19 months ago by stereoscott

Sample PDF that has null dimensions... result of incompatible PDF, or server side issues?

Changed 19 months ago by stereoscott

I think it's stemming from missing dimensions in the a_media_item table for certain pdfs. My guess is it's either due to the PDF file itself, or it's a server-side issue that is preventing the pdf dimensions to be calculated. I'll attach a PDF here that is getting added to the media library with NULL dimensions on my end.

Changed 13 months ago by geoffd

  • milestone changed from 1.4.2 to 1.5.1
Note: See TracTickets for help on using tickets.